*************************************************************
* Title: 3_figures											*
* Authors: Peter Kuhn, Trevor Osaki, Lei Yue                *
* Purpose: Generate Figures from the paper                  *
* Date: September 2024                                      *
*************************************************************

* set-up
version 16

* set proper directory
cd $homedir
global FIG_TMP 	 	"Figures/tmp" 	 					// directory for saving temporary gphs

* IN
loc DTA_MAIN        "d1_when_is_discrimination_unfair_data_set"
loc DTA_GOOGLE		"d2_google_trends.csv"

* OUT
loc Figure_1  		 "Figures/Figure_1.png" 
loc Figure_1_EPS  	 "Figures/Figure_1.eps" 	
loc Figure_1_PDF  	 "Figures/Figure_1.pdf" 

loc Figure_A2_1 	 "Figures/Figure_A2_1.png" 
	
loc Figure_A3_1_1 	 "Figures/Figure_A3_1_1.png" 
loc Figure_A3_2_1 	 "Figures/Figure_A3_2_1.png" 
loc Figure_A3_2_3 	 "Figures/Figure_A3_2_3.png" 
loc Figure_A3_3_1 	 "Figures/Figure_A3_3_1.png" 
loc Figure_A3_3_2 	 "Figures/Figure_A3_3_2.png" 
loc Figure_A3_3_3 	 "Figures/Figure_A3_3_3.png" 
loc Figure_A3_3_4 	 "Figures/Figure_A3_3_4.png" 
loc Figure_A3_4_1 	 "Figures/Figure_A3_4_1.png" 
loc Figure_A3_4_3 	 "Figures/Figure_A3_4_3.png" 


loc Figure_A4_1_1 	 "Figures/Figure_A4_1_1.png" 			// old: Figure1.png
loc Figure_A4_2_1 	 "Figures/Figure_A4_2_1.png" 
loc Figure_A4_2_2 	 "Figures/Figure_A4_2_2.png" 
loc Figure_A4_2_3 	 "Figures/Figure_A4_2_3.png" 

loc Figure_A5_3   	 "Figures/Figure_A5_3.png" 

loc Figure_A7_1_1 	 "Figures/Figure_A7_1_1.png" 
loc Figure_A7_1_2 	 "Figures/Figure_A7_1_2.png" 
loc Figure_A7_1_3a 	 "Figures/Figure_A7_1_3a.png" 
loc Figure_A7_1_3b 	 "Figures/Figure_A7_1_3b.png" 
loc Figure_A7_2_1 	 "Figures/Figure_A7_2_1.png" 
loc Figure_A7_2_2 	 "Figures/Figure_A7_2_2.png" 
loc Figure_A7_4_1 	 "Figures/Figure_A7_4_1.png" 
loc Figure_A7_4_2 	 "Figures/Figure_A7_4_2.png" 

loc Figure_A8_1 	 "Figures/Figure_A8_1.png" 
loc Figure_A9_1 	 "Figures/Figure_A9_1.png" 
loc Figure_A10_1	 "Figures/Figure_A10_1.png" 



/* BRING DATA: d1_when_is_discrimination_unfair_data_set
------------------------------------------------------------------------------- */
use `DTA_MAIN', clear



/* ******************************** Main Paper ******************************** */

/* Figure 1: 
 * Political Differences in Fairness Ratings, by Perceived Relative Opportunities (BRO) and Discriminatee Race 
------------------------------------------------------------------------------- */

	* Panel (a) - Anti-Black
	preserve

		keep if black==1

		keep if stage_one == 1

				reg fair bro if conserv==1, cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)


				reg fair bro if conserv==0, cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid, by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [fw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [fw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(a)") subtitle("Anti-Black Discrimination") xtitle("BRO Measure") ytitle(" Mean Fairness Assessment") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		
		graph save "$FIG_TMP/Figure_1a.gph", replace

	restore

	* Panel (b) - Anti-White
	preserve

		keep if black==0

		keep if stage_one == 1

				reg fair bro if conserv==1, cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)

				reg fair bro if conserv==0, cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid, by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [fw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [fw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(b)") subtitle("Anti-White Discrimination") xtitle("BRO Measure") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		graph save "$FIG_TMP/Figure_1b.gph", replace

	restore 

	* Combine (a) and (b)
	
	grc1leg "$FIG_TMP/Figure_1a.gph" "$FIG_TMP/Figure_1b.gph", xsize(8) ysize(5) legendfrom("$FIG_TMP/Figure_1a.gph")
	graph export "`Figure_1'"		, as(png) name("Graph") replace
	graph export "`Figure_1_EPS'"	, as(eps) name("Graph") replace
	graph export "`Figure_1_PDF'"	, as(pdf) name("Graph") replace
	
	** footnotes: extra p-values
	gen bro_n3 = (bro == -3)
	gen bro_n2 = (bro == -2)
	gen bro_n1 = (bro == -1)
	gen bro_0_3 = (bro >= 0 & bro <= 3)
	gen bro_n3_n2 = (bro <= -2)
	gen bro_n = (bro < 0)

	di "Tests of Political Differences in the Fairness of Anti-Black Discrimination, by Integer Values of BRO: "
	qui reg bro_n3 conserv if ordering == 1 & black == 1, cluster(randomid)
		loc P1: di %6.3f r(table)[4,1] // p = .000
		di "Conservatives vs. Mods-Libs, BRO = -3 only, p=`P1'"
		
	qui reg bro_n2 conserv if ordering == 1 & black == 1, cluster(randomid)
		loc P2: di %6.3f r(table)[4,1] // p = .000
		di "Conservatives vs. Mods-Libs, BRO = -2 only, p=`P2'"
		
	qui reg bro_n1 conserv if ordering == 1 & black == 1, cluster(randomid)
		loc P3: di %6.3f r(table)[4,1] // p = .658
		di "Conservatives vs. Mods-Libs, BRO = -1 only, p=`P3'"
		
	qui reg bro_0_3 conserv if ordering == 1 & black == 1, cluster(randomid)
		loc P4: di %6.3f r(table)[4,1] // p = .000
		di "Conservatives vs. Mods-Libs, BRO = 0 to +3 combined, p=`P4'"


		

		
/* ******************************** Appendix 2 ******************************** */

/* Figure A2.1: Frequency of Google Searches for BLM and Related Keywords around the Survey Date
------------------------------------------------------------------------------- */
preserve 

	clear
	
		insheet using `DTA_GOOGLE', clear

		gen day2 = date(day,"MDY")

		rename day2 Date

		tset Date

		#d;
		graph twoway 
		(tsline blm, lpattern(solid))
		(tsline discrimination, lpattern(dash))
		(tsline racism, lpattern(longdash_dot) lwidth(medthick)), 
		tline(22181, lpattern(dash)) 
		tline(22194, lpattern(dash)) 
		xlab(22061 "5/26/2020" 22092 "6/26/2020" 22122 "7/26/2020" 22153 "8/26/2020" 22184 "9/26/2020" 22214 "10/26/2020" 22245 "11/26/2020") 
		title("Google Search Trends") 
		legend(row(1)) ylabel(,grid)
		;
		#d cr
		graph export `Figure_A2_1', as(png) name("Graph") replace


restore
		
	
/* ******************************** Appendix 3 ******************************** */
		
/* Figure A3.1.1: Fairness and the Order of Scenarios
------------------------------------------------------------------------------- */
preserve 

	gen first_scenario = (ordering == 1)
	gen second_scenario = (ordering == 2)
	gen third_scenario = (ordering == 3)
	gen fourth_scenario = (ordering == 4)

	* Obtain CIs for the figure 
	mean fair if ordering == 1

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if ordering == 2
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if ordering == 3

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if ordering == 4

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
	
	** footnotes:
	qui reg fair first_scenario if first_scenario == 1 | second_scenario == 1, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "First scenario vs. second, p = `P_VALUE'." // p = .412
	
	qui reg fair second_scenario if second_scenario == 1 | third_scenario == 1, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "Second scenario vs. third, p = `P_VALUE'." // p = .819
	
	qui reg fair third_scenario if third_scenario == 1 | fourth_scenario == 1, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "Third scenario vs. fourth, p = `P_VALUE'." // p = .567
	
	qui reg fair fourth_scenario if first_scenario == 1 | fourth_scenario == 1, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "First scenario vs. fourth, p = `P_VALUE'." // p = .101
	
	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(ordering)
	
			gen 	 hifair = hifair_1 if ordering == 1
			replace  hifair = hifair_2 if ordering == 2
			replace  hifair = hifair_3 if ordering == 3
			replace  hifair = hifair_4 if ordering == 4
		
			gen		 lowfair = lowfair_1 if ordering == 1
			replace  lowfair = lowfair_2 if ordering == 2
			replace  lowfair = lowfair_3 if ordering == 3
			replace  lowfair = lowfair_4 if ordering == 4
				
				assert n == `N_1' if ordering == 1
				assert n == `N_2' if ordering == 2
				assert n == `N_3' if ordering == 3
				assert n == `N_4' if ordering == 4
				
	gen order_count = ordering if ordering == 1
	replace order_count = ordering + 0.25 if ordering == 2
	replace order_count = ordering + 0.50 if ordering == 3
	replace order_count = ordering + 0.75 if ordering == 4

	sort order_count

	#d ;
		graph twoway 
		(bar meanfair order_count if ordering == 1, color(cranberry*.55)) 
		(bar meanfair order_count if ordering == 2, color(cranberry*.55)) 
		(bar meanfair order_count if ordering == 3, color(cranberry*.55)) 
		(bar meanfair order_count if ordering == 4, color(cranberry*.55)) 
		(scatter meanfair order_count if ordering == 1,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair order_count if ordering == 2,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair order_count if ordering == 3,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair order_count if ordering == 4,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(rcap hifair lowfair order_count,lcolor(black))
		, 
		legend(off) 
		xlabel(1 `" "First Scenario" "Encountered" "' 2.25 `" "Second Scenario" "Encountered" "' 3.50 `" "Third Scenario" "Encountered" "' 4.75 `" "Fourth Scenario" "Encountered" "') 
		xtitle("") 
		yline(0) 
		ysc(r(-1.0 0.5)) 
		ylabel(-1.0(0.5)0.5, format(%4.1f) grid) 
		ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1', `N_2', `N_3', and `N_4', respectively.")
	;
	#d cr
	
	graph export `Figure_A3_1_1', as(png) name("Graph") replace


restore

	
	
/* Figure A3.2.1: Stage 2 Fairness Assessments by Stage 1 Treatment: Taste versus Statistical
------------------------------------------------------------------------------- */
preserve

	keep if stage_two == 1

	gen treat = (taste == 1)
	replace treat = 2 if taste == 0

	gen first = (taste1 == 1)
	replace first = 2 if taste1 == 0

	* Obtain CIs for the figure 
	mean fair if treat == 1 & first == 1, cluster(randomid)

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if treat == 2 & first == 1, cluster(randomid)
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if treat == 1 & first == 2, cluster(randomid)

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if treat == 2 & first == 2, cluster(randomid)

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
		
	** footnotes:
	* A vs B
	reg fair taste1 if taste == 1, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "A vs B, p = `P_VALUE'."	// p = .834

	* C vs D
	reg fair taste1 if taste == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "C vs D, p = `P_VALUE'." // p = .755

	* A vs C
	reg fair taste if taste1 == 1, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "A vs C, p = `P_VALUE'." // p = .675

	* B vs D
	reg fair taste if taste1 == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "B vs D, p = `P_VALUE'." // p = .314

	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair, by(treat first)

			gen 	 hifair = hifair_1 if first == 1 & treat == 1
			replace  hifair = hifair_2 if first == 1 & treat == 2
			replace  hifair = hifair_3 if first == 2 & treat == 1
			replace  hifair = hifair_4 if first == 2 & treat == 2
		
			gen		 lowfair = lowfair_1 if first == 1 & treat == 1
			replace  lowfair = lowfair_2 if first == 1 & treat == 2
			replace  lowfair = lowfair_3 if first == 2 & treat == 1
			replace  lowfair = lowfair_4 if first == 2 & treat == 2

				assert n == `N_1' if first == 1 & treat == 1
				assert n == `N_2' if first == 1 & treat == 2
				assert n == `N_3' if first == 2 & treat == 1
				assert n == `N_4' if first == 2 & treat == 2
				
	gen x = 1 if first == 1
	replace x = first + 1 if first == 2

	#d ;
		twoway 
		(bar meanfair x if treat == 1 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 1 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 1 & first == 1,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair x if treat == 1 & first == 2,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(rcap hifair lowfair x if treat == 1 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 1 & first == 2,lcolor(black))
		, legend(off) 
		title("Fairness of Taste-based" "Discrimination in Stage 2" "(a)", size(medium)) 
		xlabel(1 `""A" "Taste Treatment" "in Stage 1""' 3 `""B" "Statistical Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1 0.5)) ylabel(-1(0.5)0.5, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1' and `N_3', respectively.")
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A3_2_1a.gph", replace

	#d ;
		twoway 
		(bar meanfair x if treat == 2 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 2 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 2 & first == 1,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair x if treat == 2 & first == 2,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(rcap hifair lowfair x if treat == 2 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 2 & first == 2,lcolor(black))
		, legend(off) 
		title( "Fairness of Statistical" "Discrimination in Stage 2" "(b)", size(medium)) 
		xlabel(1 `""C" "Taste Treatment" "in Stage 1""' 3 `""D" "Statistical Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1 0.5)) ylabel(-1(0.5)0.5, grid nolabels noticks format(%4.1f)) ytitle("")
		note("Num. obs. are `N_2' and `N_4', respectively.")
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A3_2_1b.gph", replace

	graph combine "$FIG_TMP/Figure_A3_2_1a.gph" "$FIG_TMP/Figure_A3_2_1b.gph"

	graph export `Figure_A3_2_1', replace

restore 				



/* Figure A3.2.3: Comparison of Taste Treatment Effect Estimates
------------------------------------------------------------------------------- */

	qui reg fair taste if ordering == 1
	est store between
	loc N_1 `e(N)'
	
	qui reg fair taste i.randomid
	est store within
	loc N_2 `e(N)'

	qui reg fair taste
	est store all
	loc N_3 `e(N)'
	
	** footnotes
	
	qui suest between within all, cluster(randomid)

	test [between_mean]taste = [within_mean]taste
	loc P_VALUE: di %6.3f r(p) // p = .574
	di "Between vs. Within-subject, p = `P_VALUE'."
	
	test [within_mean]taste = [all_mean]taste
	loc P_VALUE: di %6.3f r(p) // p = .312
	di "Within-subject vs. Pooled, p = `P_VALUE'."
	
	test [all_mean]taste = [between_mean]taste
	loc P_VALUE: di %6.3f r(p) // p = .205
	di "Pooled vs. Between-subject, p = `P_VALUE'."

	#d ;
		coefplot 
		(between, label("Between-subject") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(2)) 
		(within, label("Within-subject") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4)) 
		(all, label("Both") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4)) 
		, vertical legend(off) keep(taste) 
		recast(bar) ciopts(recast(rcap) lcolor(black)) citop barwidt(0.2) 
		title("Taste-based versus Statistical Scenarios") 
		yscale(r(-0.25,0.5)) ytitle("Treatment Effect") ylab(-0.25 0 0.25 0.5, grid format(%4.2f)) yline(0) 
		xlab(0.75 "Between-subject" 1 "Within-subject" 1.25 "Pooled")
		/* note("Num. obs. are `N_1', `N_2', and `N_3', respectively.") */
	;
	#d cr
	
	graph export `Figure_A3_2_3', as(png) name("Graph") replace
		
		
/* Figure A3.3.1: Mean Fairness Ratings by the First Scenario Encountered in Stage 1
------------------------------------------------------------------------------- */
preserve

	keep if stage_one == 1

	gen justifiability = (low_just == 1)
	replace justifiability = 2 if low_just == 0

	* Obtain CIs for the figure 
	mean fair if justifiability == 1 & low_just1 == 1

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if justifiability == 2 & low_just1 == 1
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if justifiability == 1 & low_just1 == 0

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if justifiability == 2 & low_just1 == 0

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	** footnotes
	reg fair low_just if low_just1 == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "M vs N, p = `P_VALUE'." // p = .000

	reg fair low_just if low_just1 == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "O vs P, p = `P_VALUE'." // p = .000

	reg fair low_just1 if low_just == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "M vs O, p = `P_VALUE'." // p = .537

	reg fair low_just1 if low_just == 0,cluster(randomid) 
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "N vs P, p = `P_VALUE'." // p = .521

	reg fair low_just if low_just1 == 1 
	est store A
	reg fair low_just if low_just1 == 0 
	est store B

	suest A B, cluster(randomid)

	test [A_mean]low_just = [B_mean]low_just
	loc P_VALUE: di %6.3f r(p) // p = .979
	di "Equality test for switchers: M – N = O – P: p = `P_VALUE'." 

	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(justifiability low_just1)

			gen 	 hifair = hifair_1 if justifiability == 1 & low_just1 == 1
			replace  hifair = hifair_2 if justifiability == 2 & low_just1 == 1
			replace  hifair = hifair_3 if justifiability == 1 & low_just1 == 0
			replace  hifair = hifair_4 if justifiability == 2 & low_just1 == 0
		
			gen		 lowfair = lowfair_1 if justifiability == 1 & low_just1 == 1
			replace  lowfair = lowfair_2 if justifiability == 2 & low_just1 == 1
			replace  lowfair = lowfair_3 if justifiability == 1 & low_just1 == 0
			replace  lowfair = lowfair_4 if justifiability == 2 & low_just1 == 0

				assert n == `N_1' if justifiability == 1 & low_just1 == 1
				assert n == `N_2' if justifiability == 2 & low_just1 == 1
				assert n == `N_3' if justifiability == 1 & low_just1 == 0
				assert n == `N_4' if justifiability == 2 & low_just1 == 0

	gen x = 1 if justifiability == 1
	replace x = justifiability + 1 if justifiability == 2

	#d ;
		twoway 
		(bar meanfair x if justifiability == 1 & low_just1 == 1, color(cranberry*.55)) 
		(bar meanfair x if justifiability == 2 & low_just1 == 1, color(eltblue*.50)) 
		(scatter meanfair x if justifiability == 1 & low_just1 == 1,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair x if justifiability == 2 & low_just1 == 1,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2)) 
		(rcap hifair lowfair x if low_just1 == 1,lcolor(black))
		, legend(off) title("Subjects who Encountered" "Less Justifiable Treatment First", size(medium)) 
		xlabel(1 `""M" "Less Justifiable (first)""' 3 `""N" "More Justifiable""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.1 0.5)) ylabel(-1.0(0.5)0.5, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1' and `N_2', respectively.")
	;
	# d cr
	graph save "$FIG_TMP/Figure_A3_3_1a.gph", replace

	#d ;
		twoway 
		(bar meanfair x if justifiability == 1 & low_just1 == 0, color(cranberry*.55)) 
		(bar meanfair x if justifiability == 2 & low_just1 == 0, color(eltblue*.50)) 
		(scatter meanfair x if justifiability == 1 & low_just1 == 0,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair x if justifiability == 2 & low_just1 == 0,msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2)) 
		(rcap hifair lowfair x if low_just1 == 0,lcolor(black))
		, legend(off) title("Subjects who Encountered" "More Justifiable Treatment First", size(medium))
		xlabel(1 `""O" "Less Justifiable""' 3 `""P" "More Justifiable (first)""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.1 0.5)) ylabel(-1.0(0.5)0.5, grid noticks nolabels format(%4.1f)) ytitle("")
		note("Num. obs. are `N_3' and `N_4', respectively.")
	;
	# d cr
	graph save "$FIG_TMP/Figure_A3_3_1b.gph", replace

	graph combine "$FIG_TMP/Figure_A3_3_1a.gph" "$FIG_TMP/Figure_A3_3_1b.gph"

	graph export `Figure_A3_3_1', as(png) name("Graph") replace

restore


/* Figure A3.3.2: Mean Fairness of Respondents by the First Scenario they Encountered in Stage 2
------------------------------------------------------------------------------- */

preserve

	keep if stage_one == 0

	gen justifiability = (low_just == 1)
	replace justifiability = 2 if low_just == 0
	
	* Obtain CIs for the figure 
	mean fair if justifiability == 1 & low_just3 == 1

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if justifiability == 2 & low_just3 == 1
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if justifiability == 1 & low_just3 == 0

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if justifiability == 2 & low_just3 == 0

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	** footnotes
	reg fair low_just if low_just3 == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "Q vs R, p = `P_VALUE'." // p = .000

	reg fair low_just if low_just3 == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "R vs S, p = `P_VALUE'." // p = .000

	reg fair low_just3 if low_just == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "Q vs S, p = `P_VALUE'." // p = .798

	reg fair low_just3 if low_just == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "R vs T, p = `P_VALUE'." // p = .489

	reg fair low_just if low_just3 == 1 
	est store A
	reg fair low_just if low_just3 == 0 
	est store B

	suest A B, cluster(randomid)

	test [A_mean]low_just = [B_mean]low_just
	loc P_VALUE: di %6.3f r(p) // p = .289
	di "Equality test for switchers: Q – R = S – T: p = `P_VALUE'." 

	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(justifiability low_just3)

			gen 	 hifair = hifair_1 if justifiability == 1 & low_just3 == 1
			replace  hifair = hifair_2 if justifiability == 2 & low_just3 == 1
			replace  hifair = hifair_3 if justifiability == 1 & low_just3 == 0
			replace  hifair = hifair_4 if justifiability == 2 & low_just3 == 0
		
			gen		 lowfair = lowfair_1 if justifiability == 1 & low_just3 == 1
			replace  lowfair = lowfair_2 if justifiability == 2 & low_just3 == 1
			replace  lowfair = lowfair_3 if justifiability == 1 & low_just3 == 0
			replace  lowfair = lowfair_4 if justifiability == 2 & low_just3 == 0

				assert n == `N_1' if justifiability == 1 & low_just3 == 1
				assert n == `N_2' if justifiability == 2 & low_just3 == 1
				assert n == `N_3' if justifiability == 1 & low_just3 == 0
				assert n == `N_4' if justifiability == 2 & low_just3 == 0
				
	gen x = 1 if justifiability == 1
	replace x = justifiability + 1 if justifiability == 2

	#d ;
		twoway 
		(bar meanfair x if justifiability == 1 & low_just3 == 1, color(cranberry*.55)) 
		(bar meanfair x if justifiability == 2 & low_just3 == 1, color(eltblue*.50)) 
		(scatter meanfair x if justifiability == 1 & low_just3 == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair x if justifiability == 2 & low_just3 == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2)) 
		(rcap hifair lowfair x if low_just3 == 1,lcolor(black))
		, legend(off) title("Subjects who Encountered" "Less Justifiable Treatment First", size(medium)) 
		xlabel(1 `""Q" "Less Justifiable (first)""' 3 `""R" "More Justifiable""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.1 0.5)) ylabel(-1.0(0.5)0.5, grid format(%4.1f)) ytitle("Mean Fairness Evaluation") 
		note("Num. obs. are `N_1' and `N_2', respectively.")
	;
	#d cr
	graph save "$FIG_TMP/Figure_A3_3_2a.gph", replace

	#d ;
		twoway 
		(bar meanfair x if justifiability == 1 & low_just3 == 0, color(cranberry*.55)) 
		(bar meanfair x if justifiability == 2 & low_just3 == 0, color(eltblue*.50)) 
		(scatter meanfair x if justifiability == 1 & low_just3 == 0, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4)) 
		(scatter meanfair x if justifiability == 2 & low_just3 == 0, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2)) 
		(rcap hifair lowfair x if low_just3 == 0,lcolor(black))
		, legend(off) title("Subjects who Encountered" "More Justifiable Treatment First", size(medium)) 
		xlabel(1 `""S" "Less Justifiable""' 3 `""T" "More Justifiable (first)""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.1 0.5)) ylabel(-1.0(0.5)0.5, noticks nolabels grid format(%4.1f)) ytitle("")
		note("Num. obs. are `N_3' and `N_4', respectively.")
	;
	#d cr
	graph save "$FIG_TMP/Figure_A3_3_2b.gph", replace


	graph combine "$FIG_TMP/Figure_A3_3_2a.gph" "$FIG_TMP/Figure_A3_3_2b.gph"

	graph export `Figure_A3_3_2', as(png) name("Graph") replace


restore


/* Figure A3.3.3: Mean Fairness of Respondents by the Scenario Ordering they Encountered,
Pooling Stages 1 and 2
------------------------------------------------------------------------------- */

preserve

	gen order2 = 1 if ordering == 1 | ordering == 3
	replace order2 = 2 if ordering == 2 | ordering == 4

	gen first_scenario = (order2 == 1)
	
	gen justifiability = (low_just == 1)
	replace justifiability = 2 if low_just == 0
	
	* Obtain CIs for the figure 
	mean fair if justifiability == 1 & order2 == 1, cluster(randomid)

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if justifiability == 2 & order2 == 1, cluster(randomid)
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if justifiability == 1 & order2 == 2, cluster(randomid)

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if justifiability == 2 & order2 == 2, cluster(randomid)

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	** footnotes
	qui reg fair low_just if first_scenario == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "U vs V, p = `P_VALUE'." // p = .000

	qui reg fair low_just if first_scenario == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "W vs X, p = `P_VALUE'." // p = .000

	qui reg fair first_scenario if low_just == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "U vs W, p = `P_VALUE'." // p = .576

	qui reg fair first_scenario if low_just == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "V vs X, p = `P_VALUE'." // p = .947

	qui reg fair low_just if ordering == 1 | ordering == 3
	est store A
	qui reg fair low_just if ordering == 2 | ordering == 4
	est store B

	suest A B, cluster(randomid)

	test [A_mean]low_just = [B_mean]low_just
	loc P_VALUE: di %6.3f r(p) // p = .770
	di "Equality test for switchers:U – V = W – X: p = `P_VALUE'." 

	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(order2 justifiability)

			gen 	 hifair = hifair_1 if justifiability == 1 & order2 == 1
			replace  hifair = hifair_2 if justifiability == 2 & order2 == 1
			replace  hifair = hifair_3 if justifiability == 1 & order2 == 2
			replace  hifair = hifair_4 if justifiability == 2 & order2 == 2
		
			gen		 lowfair = lowfair_1 if justifiability == 1 & order2 == 1
			replace  lowfair = lowfair_2 if justifiability == 2 & order2 == 1
			replace  lowfair = lowfair_3 if justifiability == 1 & order2 == 2
			replace  lowfair = lowfair_4 if justifiability == 2 & order2 == 2

				assert n == `N_1' if justifiability == 1 & order2 == 1
				assert n == `N_2' if justifiability == 2 & order2 == 1
				assert n == `N_3' if justifiability == 1 & order2 == 2
				assert n == `N_4' if justifiability == 2 & order2 == 2

	gen x = 1 if justifiability == 1
	replace x = justifiability + 1 if justifiability == 2

	#d ;
	twoway 
	(bar meanfair x if justifiability == 1 & order2 == 1, color(cranberry*.55)) 
	(bar meanfair x if justifiability == 2 & order2 == 1, color(eltblue*.50)) 
	(scatter meanfair x if justifiability == 1 & order2 == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
	(scatter meanfair x if justifiability == 2 & order2 == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
	(rcap hifair lowfair x if order2 == 1,lcolor(black)), 
	legend(off) title("First Scenario Encountered", size(medium)) 
	xlabel(1 `""U" "Less Justifiable""' 3 `""V" "More Justifiable""') xtitle("") xsc(r(0 4)) 
	yline(0) ysc(r(-1.1 0.5)) ylabel(-1.0(0.5)0.5, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
	note("Num. obs. are `N_1' and `N_2', respectively.")
	;
	#d cr
	graph save "$FIG_TMP/Figure_A3_3_3a.gph", replace

	
	#d ;
	twoway 
	(bar meanfair x if justifiability == 1 & order2 == 2, color(cranberry*.55)) 
	(bar meanfair x if justifiability == 2 & order2 == 2, color(eltblue*.50)) 
	(scatter meanfair x if justifiability == 1 & order2 == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
	(scatter meanfair x if justifiability == 2 & order2 == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
	(rcap hifair lowfair x if order2 == 2,lcolor(black))
	, legend(off) title("Second Scenario Encountered", size(medium))
	xlabel(1 `""W" "Less Justifiable""' 3 `""X" "More Justifiable""') xtitle("") xsc(r(0 4)) 
	yline(0) ysc(r(-1.1 0.5)) ylabel(-1.0(0.5)0.5, noticks nolabels grid format(%4.1f)) ytitle("")
	note("Num. obs. are `N_3' and `N_4', respectively.")
	;
	#d cr
	graph save "$FIG_TMP/Figure_A3_3_3b.gph", replace

	graph combine "$FIG_TMP/Figure_A3_3_3a.gph" "$FIG_TMP/Figure_A3_3_3b.gph"

	graph export `Figure_A3_3_3', as(png) name("Graph") replace

restore



/* Figure A3.3.4: Comparison of Less Justifiable Treatment Effect Estimates
------------------------------------------------------------------------------- */
preserve 
	estimates clear

	qui reg fair low_just if ordering == 1
	est store between
	loc N_1 `e(N)'
							
	qui reg fair low_just i.randomid
	est store within
	loc N_2 `e(N)'
	
	qui reg fair low_just
	est store all
	loc N_3 `e(N)'

	** footnotes
	
	qui suest between within all, cluster(randomid)

	test [between_mean]low_just = [within_mean]low_just
	loc P_VALUE: di %6.3f r(p) // p = .498
	di "Between vs. Within-subject, p = `P_VALUE'."

	test [within_mean]low_just = [all_mean]low_just
	loc P_VALUE: di %6.3f r(p) // p = 1.000
	di "Within-subject vs. Pooled, p = `P_VALUE'."

	test [all_mean]low_just = [between_mean]low_just
	loc P_VALUE: di %6.3f r(p) // p = .498
	di "Pooled vs. Between-subject, p = `P_VALUE'."

	#d ;
		coefplot 
		(between, label("Between-subject") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4)) 
		(within, label("Within-subject") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4)) 
		(all, label("Both") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4)) 
		, vertical legend(off) keep(low_just) recast(bar) ciopts(recast(rcap) lcolor(black)) citop barwidt(0.2) 
		title("Less versus More-Justifiable Scenarios") 
		yscale(r(-1.0,0.5)) ytitle("Treatment Effect") ylab(-1.0 -0.5 0 0.5, grid format(%4.1f)) yline(0) 
		xlab(0.75 "Between-subject" 1 "Within-subject" 1.25 "Pooled")
		/* note("Num. obs. are `N_1', `N_2', and `N_3', respectively.") */
	;
	#d cr

	graph export `Figure_A3_3_4', as(png) name("Graph") replace
				
restore 				
				
/* Figure A3.4.1: Subjects' Stage 2 Fairness Assessments, by their Stage 1 Race Treatment
------------------------------------------------------------------------------- */
preserve

	keep if stage_two == 1

	gen treat = (black == 1)
	replace treat = 2 if black == 0

	gen first = (black1 == 1)
	replace first = 2 if black1 == 0

	* Obtain CIs for the figure 
	mean fair if treat == 1 & first == 1, cluster(randomid)

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if treat == 1 & first == 2, cluster(randomid)
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if treat == 2 & first == 1, cluster(randomid)

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if treat == 2 & first == 2, cluster(randomid)

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	* footnotes
	qui reg fair black1 if black == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "A vs B, p = `P_VALUE'." // p = .055

	qui reg fair black1 if black == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "C vs D, p = `P_VALUE'." // p = .385

	qui reg fair black if black1 == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "A vs C, p = `P_VALUE'." // p = .012

	qui reg fair black if black1 == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1]
	di "B vs D, p = `P_VALUE'." // p = . 767

	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(treat first)

			gen 	 hifair = hifair_1 if treat == 1 & first == 1
			replace  hifair = hifair_2 if treat == 1 & first == 2
			replace  hifair = hifair_3 if treat == 2 & first == 1
			replace  hifair = hifair_4 if treat == 2 & first == 2
		
			gen		 lowfair = lowfair_1 if treat == 1 & first == 1
			replace  lowfair = lowfair_2 if treat == 1 & first == 2
			replace  lowfair = lowfair_3 if treat == 2 & first == 1
			replace  lowfair = lowfair_4 if treat == 2 & first == 2

				assert n == `N_1' if treat == 1 & first == 1
				assert n == `N_2' if treat == 1 & first == 2
				assert n == `N_3' if treat == 2 & first == 1
				assert n == `N_4' if treat == 2 & first == 2

	gen x = 1 if first == 1
	replace x = first + 1 if first == 2

	#d;
		twoway 
		(bar meanfair x if treat == 1 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 1 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 1 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(scatter meanfair x if treat == 1 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(rcap hifair lowfair x if treat == 1 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 1 & first == 2,lcolor(black))
		, legend(off) title("Fairness of Anti-Black" "Discrimination in Stage 2" "(a)", size(medium)) 
		xlabel(1 `""A" "Black Treatment" "in Stage 1""' 3 `""B" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1 0.5)) ylabel(-1(0.5)0.5, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1' and `N_2', respectively.")
	;
	#d cr
	graph save "$FIG_TMP/Figure_A3_4_1a.gph", replace


	#d;
		twoway 
		(bar meanfair x if treat == 2 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 2 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 2 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(scatter meanfair x if treat == 2 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(rcap hifair lowfair x if treat == 2 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 2 & first == 2,lcolor(black))
		, legend(off) title( "Fairness of Anti-White" "Discrimination in Stage 2" "(b)", size(medium)) 
		xlabel(1 `""C" "Black Treatment" "in Stage 1""' 3 `""D" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1 0.5)) ylabel(-1(0.5)0.5, grid format(%4.1f) nolabels noticks) ytitle("")
		note("Num. obs. are `N_3' and `N_4', respectively.")
	;
	#d cr
	graph save "$FIG_TMP/Figure_A3_4_1b.gph", replace

	graph combine "$FIG_TMP/Figure_A3_4_1a.gph" "$FIG_TMP/Figure_A3_4_1b.gph"

	graph export `Figure_A3_4_1', replace

restore 



/* Figure A3.4.3: Comparison of Black Treatment Effect Estimates
------------------------------------------------------------------------------- */
preserve 

	qui reg fair black if ordering == 1
	est store between
	loc N_1 `e(N)'
	
	qui reg fair black i.randomid
	est store within
	loc N_2 `e(N)'
	
	qui reg fair black
	est store all
	loc N_3 `e(N)'

	** footnotes
	
	qui suest between within all,cluster(randomid)

	test [between_mean]black = [within_mean]black
	loc P_VALUE: di %6.3f r(p) // p = .010
	di "Between vs. Within-subject, p = `P_VALUE'."
	
	test [within_mean]black = [all_mean]black
	loc P_VALUE: di %6.3f r(p) // p = .647
	di "Within-subject vs. Pooled, p = `P_VALUE'."
	
	test [all_mean]black = [between_mean]black
	loc P_VALUE: di %6.3f r(p) // p = .007
	di "Pooled vs. Between-subject, p = `P_VALUE'." 
	
	#d;
		coefplot 
		(between, label("Between-subject") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4)) 
		(within, label("Within-subject") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4))  
		(all, label("Both") bcolor(cranberry*0.55) mlabel(@b) mlabcolor(black) mlabformat(%4.2f) mlabposition(4)) 
		, vertical legend(off) keep(black) recast(bar) ciopts(recast(rcap) lcolor(black)) citop barwidt(0.2) 
		title("Black versus White Discriminatee") 
		yscale(r(-1.0,0.5)) ytitle("Treatment Effect") ylab(-1.0 -0.5 0 0.5, grid format(%4.1f)) yline(0) 
		xlab(0.75 "Between-subject" 1 "Within-subject" 1.25 "Pooled")
		/* note("Num. obs. are `N_1', `N_2', and `N_3', respectively.") */
	;
	#d cr
	
	graph export `Figure_A3_4_3', as(png) name("Graph") replace
restore 


/* ******************************** Appendix 4 ******************************** */ 


/* Figure A4.1.1: Mean Fairness of Discriminatory Actions by Respondents Characteristics 
------------------------------------------------------------------------------- */

	*** Part a - Figure for respondent gender ***

		preserve 

			keep if stage_one == 1

			gen gender_num = (male == 1)
			replace gender_num = 2 if female == 1

			*Obtain p-value
			reg fair male, cluster(randomid)
			* p = .037
			

			* Obtain CIs for the figure 
			mean fair if gender_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if gender_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(gender_num)
			
				gen 	 hifair = hifair_1 if gender_num == 1
				replace  hifair = hifair_2 if gender_num == 2

				gen		 lowfair = lowfair_1 if gender_num == 1
				replace  lowfair = lowfair_2 if gender_num == 2
				
				assert n == `N_1' if gender_num == 1
				assert n == `N_2' if gender_num == 2

			gen x = gender_num if gender_num == 1
			replace x = gender_num + 0.25 if gender_num == 2
				
			sort x
		
			#d ;
				graph twoway 
						(bar meanfair x if gender_num == 1, color(cranberry*.55)) 
						(bar meanfair x if gender_num == 2, color(cranberry*.55)) 
						(scatter meanfair x if gender_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
						(scatter meanfair x if gender_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
						(rcap hifair lowfair x,lcolor(black))
						, 
						legend(off) 
						xlabel(1 "Male" 2.25 "Female") xtitle("") 
						yline(0) ysc(r(-1.1 0.7)) ylabel(-1.0(0.5)0.5, format(%4.1f) grid) ytitle("Mean Fairness Evaluation") 
						title("(a)") subtitle("Gender")
						note("Num. obs. are `N_1', `N_2', respectively.")
				;
			#d cr
				graph save "$FIG_TMP/gender.gph", replace

		restore

	*** Part b - Figure for respondent age ***

		preserve 

			keep if stage_one == 1

			gen age_num = (age18_34 == 1)
			replace age_num = 2 if age35_44 == 1
			replace age_num = 3 if age45_54 == 1
			replace age_num = 4 if age55_over == 1

			* Obtain p-values 
			reg fair age18_34 if age_num == 1 | age_num == 2, cluster(randomid)
			* p = .386
			reg fair age35_44 if age_num == 2 | age_num == 3, cluster(randomid)
			* p = .766
			reg fair age45_54 if age_num == 3 | age_num == 4, cluster(randomid)
			* p = .805
			reg fair age55_over if age_num == 4 | age_num == 1, cluster(randomid)
			* p = .560
			

			* Obtain CIs for the figure 
			mean fair if age_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if age_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if age_num == 3, cluster(randomid)
		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]
				loc		  	 N_3 = e(N)
				
			mean fair if age_num == 4, cluster(randomid)
			
				scalar  hifair_4 = r(table)["ul", "fair"]
				scalar lowfair_4 = r(table)["ll", "fair"]	
				loc		  	 N_4 = e(N)

			collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(age_num)

				gen 	 hifair = hifair_1 if age_num == 1
				replace  hifair = hifair_2 if age_num == 2
				replace  hifair = hifair_3 if age_num == 3
				replace  hifair = hifair_4 if age_num == 4
		
				gen		 lowfair = lowfair_1 if age_num == 1
				replace  lowfair = lowfair_2 if age_num == 2
				replace  lowfair = lowfair_3 if age_num == 3
				replace  lowfair = lowfair_4 if age_num == 4
				
				assert n == `N_1' if age_num == 1
				assert n == `N_2' if age_num == 2
				assert n == `N_3' if age_num == 3
				assert n == `N_4' if age_num == 4
				

			gen x = age_num if age_num == 1
			replace x = age_num + 0.25 if age_num == 2
			replace x = age_num + 0.50 if age_num == 3
			replace x = age_num + 0.75 if age_num == 4

			sort x
			
			#d ;
				graph twoway 
					(bar meanfair x if age_num == 1, color(cranberry*.55)) 
					(bar meanfair x if age_num == 2, color(cranberry*.55)) 
					(bar meanfair x if age_num == 3, color(cranberry*.55)) 
					(bar meanfair x if age_num == 4, color(cranberry*.55)) 
					(scatter meanfair x if age_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if age_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if age_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if age_num == 4, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(rcap hifair lowfair x,lcolor(black))
					, 
					legend(off) 
					xlabel(1 "18-34" 2.25 "35-44" 3.50 "45-54" 4.75 "55+") xtitle("") 
					yline(0) ysc(r(-1.1 0.7)) ylabel(-1.0(0.5)0.5, format(%4.1f) grid) 
					title("(b)") subtitle("Age")
					note("Num. obs. are `N_1', `N_2', `N_3', `N_4', respectively.")
			;
			#d cr
			
			graph save "$FIG_TMP/age.gph", replace

		restore


	*** Part c - Figure for respondent race ***

		preserve 

			keep if stage_one == 1

			gen race_num = (race_white == 1)
			replace race_num = 2 if race_black == 1
			replace race_num = 3 if other == 1

			* Obtain p-values
			reg fair race_white if race_num == 1 | race_num == 2, cluster(randomid)
			* p = .204
			reg fair race_black if race_num == 2 | race_num == 3, cluster(randomid)
			* p = .058
			reg fair other if race_num == 3 | race_num == 1, cluster(randomid)
			* p = .197

			* Obtain CIs for the figure 
			mean fair if race_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if race_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if race_num == 3, cluster(randomid)
		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]
				loc		  	 N_3 = e(N)


			collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(race_num)

				gen 	 hifair = hifair_1 if race_num == 1
				replace  hifair = hifair_2 if race_num == 2
				replace  hifair = hifair_3 if race_num == 3
		
				gen		 lowfair = lowfair_1 if race_num == 1
				replace  lowfair = lowfair_2 if race_num == 2
				replace  lowfair = lowfair_3 if race_num == 3
				
				assert n == `N_1' if race_num == 1
				assert n == `N_2' if race_num == 2
				assert n == `N_3' if race_num == 3

			gen x = race_num if race_num == 1
			replace x = race_num + 0.25 if race_num == 2
			replace x = race_num + 0.50 if race_num == 3

			sort x

			#d ;
				graph twoway 
					(bar meanfair x if race_num == 1, color(cranberry*.55)) 
					(bar meanfair x if race_num == 2, color(cranberry*.55)) 
					(bar meanfair x if race_num == 3, color(cranberry*.55)) 
					(scatter meanfair x if race_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if race_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if race_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(rcap hifair lowfair x,lcolor(black))
					, 
					legend(off) 
					xlabel(1 `" "White" " " "' 2.25 "Black" 3.50 "Other race") xtitle("") 
					yline(0) ysc(r(-1.1 0.7)) ylabel(-1.0(0.5)0.5, format(%4.1f) grid) ytitle("Mean Fairness Evaluation") 
					title("(c)") subtitle("Race")
					note("Num. obs. are `N_1', `N_2', `N_3', respectively.")
			;
			#d cr

			graph save "$FIG_TMP/race.gph", replace

		restore


	*** Part d - Figure for respondent education ***

		preserve 

			keep if stage_one == 1

			gen edu_num = (education_hs_2year == 1)
			replace edu_num = 2 if education_four_college == 1
			replace edu_num = 3 if education_higher == 1

			* Obtain p-values
			reg fair education_hs_2year if edu_num != 3, cluster(randomid)
			* p =.000
			reg fair education_four_college if edu_num != 1, cluster(randomid)
			* p = .246
			reg fair education_higher if edu_num !=2, cluster(randomid)
			* p = .000

			* Obtain CIs for the figure 
			mean fair if edu_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if edu_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if edu_num == 3, cluster(randomid)
		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]
				loc		  	 N_3 = e(N)


			collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(edu_num)

				gen 	 hifair = hifair_1 if edu_num == 1
				replace  hifair = hifair_2 if edu_num == 2
				replace  hifair = hifair_3 if edu_num == 3
		
				gen		 lowfair = lowfair_1 if edu_num == 1
				replace  lowfair = lowfair_2 if edu_num == 2
				replace  lowfair = lowfair_3 if edu_num == 3
				
				assert n == `N_1' if edu_num == 1
				assert n == `N_2' if edu_num == 2
				assert n == `N_3' if edu_num == 3

			gen x = edu_num if edu_num == 1
			replace x = edu_num + 0.25 if edu_num == 2
			replace x = edu_num + 0.50 if edu_num == 3

			sort x

			#d ;
				graph twoway 
					(bar meanfair x if edu_num == 1, color(cranberry*.55)) 
					(bar meanfair x if edu_num == 2, color(cranberry*.55)) 
					(bar meanfair x if edu_num == 3, color(cranberry*.55)) 
					(scatter meanfair x if edu_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if edu_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if edu_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(rcap hifair lowfair x,lcolor(black))
					, 
					legend(off) 
					xlabel(1 `" "HS/2-year" "College" "' 2.25 `" "4-year" "College" "' 3.50 "Grad School") xtitle("") 
					ysc(r(-1.1 0.7)) ylabel(-1.0(0.5)0.5, format(%4.1f) grid) yline(0) 
					title("(d)") subtitle("Education Level")
					note("Num. obs. are `N_1', `N_2', `N_3', respectively.")
			;
			#d cr
			
			graph save "$FIG_TMP/education.gph", replace

		restore


	*** Part e - Figure for respondent political party preference ***

		preserve 

			keep if stage_one == 1

			gen party_num = (party_republican == 1)
			replace party_num = 2 if party_indep_other == 1
			replace party_num = 3 if party_democrat == 1

			* Obtain p-values
			reg fair party_republican if party_num != 3, cluster(randomid)
			* p = .000
			reg fair party_indep_other if party_num !=1, cluster(randomid)
			* p = .961
			reg fair party_democrat if party_num !=2, cluster(randomid)
			* p = .000

			* Obtain CIs for the figure 
			mean fair if party_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if party_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if party_num == 3, cluster(randomid)
		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]
				loc		  	 N_3 = e(N)


			collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(party_num)

				gen 	 hifair = hifair_1 if party_num == 1
				replace  hifair = hifair_2 if party_num == 2
				replace  hifair = hifair_3 if party_num == 3
		
				gen		 lowfair = lowfair_1 if party_num == 1
				replace  lowfair = lowfair_2 if party_num == 2
				replace  lowfair = lowfair_3 if party_num == 3
				
				assert n == `N_1' if party_num == 1
				assert n == `N_2' if party_num == 2
				assert n == `N_3' if party_num == 3

			gen x = party_num if party_num == 1
			replace x = party_num + 0.25 if party_num == 2
			replace x = party_num + 0.50 if party_num == 3

			sort x

			#d ;
				graph twoway 
					(bar meanfair x if party_num == 1, color(cranberry*.55)) 
					(bar meanfair x if party_num == 2, color(cranberry*.55)) 
					(bar meanfair x if party_num == 3, color(cranberry*.55)) 
					(scatter meanfair x if party_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
					(scatter meanfair x if party_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if party_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(rcap hifair lowfair x,lcolor(black))
					, 
					legend(off) 
					xlabel(1 "Republican" 2.25 `" "Indep./" "Other" "' 3.50 "Democrat") xtitle("") 
					ysc(r(-1.1 0.7)) ylabel(-1.0(0.5)0.5, format(%4.1f) grid)  yline(0) ytitle("Mean Fairness Evaluation") 
					title("(e)") subtitle("Political Party Preference")
					note("Num. obs. are `N_1', `N_2', `N_3', respectively.")
			;
			#d cr
			
			graph save "$FIG_TMP/party.gph", replace

		restore


	*** Part f - Figure for respondent political leaning ***
		preserve 

			keep if stage_one == 1

			gen leaning_num = (conserv == 1)
			replace leaning_num = 2 if mod == 1
			replace leaning_num = 3 if lib == 1

			* Obtain p-values
			reg fair conserv if leaning_num != 3, cluster(randomid)
			* p = .000
			reg fair mod if leaning_num !=1, cluster(randomid)
			* p = .463
			reg fair lib if leaning_num !=2, cluster(randomid)
			* p = .000

			* Obtain CIs for the figure 
			mean fair if leaning_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if leaning_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if leaning_num == 3, cluster(randomid)
		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]
				loc		  	 N_3 = e(N)


			collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(leaning_num)

				gen 	 hifair = hifair_1 if leaning_num == 1
				replace  hifair = hifair_2 if leaning_num == 2
				replace  hifair = hifair_3 if leaning_num == 3
		
				gen		 lowfair = lowfair_1 if leaning_num == 1
				replace  lowfair = lowfair_2 if leaning_num == 2
				replace  lowfair = lowfair_3 if leaning_num == 3
				
				assert n == `N_1' if leaning_num == 1
				assert n == `N_2' if leaning_num == 2
				assert n == `N_3' if leaning_num == 3

			gen x = leaning_num if leaning_num == 1
			replace x = leaning_num + 0.25 if leaning_num == 2
			replace x = leaning_num + 0.50 if leaning_num == 3

			sort x

			#d ;
				graph twoway 
					(bar meanfair x if leaning_num == 1, color(cranberry*.55)) 
					(bar meanfair x if leaning_num == 2, color(cranberry*.55)) 
					(bar meanfair x if leaning_num == 3, color(cranberry*.55)) 
					(scatter meanfair x if leaning_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
					(scatter meanfair x if leaning_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(scatter meanfair x if leaning_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
					(rcap hifair lowfair x,lcolor(black))
					, 
					legend(off) 
					xlabel(1 `" "Conservative" " " "' 2.25 "Moderate" 3.50 "Liberal") xtitle("") 
					ysc(r(-1.1 0.7)) yline(0) ylabel(-1.0(0.5)0.5, format(%4.1f) grid) 
					title("(f)") subtitle("Political Leaning")
					note("Num. obs. are `N_1', `N_2', `N_3', respectively.")
			;
			#d cr
			graph save "$FIG_TMP/leaning.gph", replace

		restore

	*** Parts a-f: combining

		graph combine "$FIG_TMP/gender.gph" "$FIG_TMP/age.gph" "$FIG_TMP/race.gph" "$FIG_TMP/education.gph" "$FIG_TMP/party.gph" "$FIG_TMP/leaning.gph", rows(3) xsize(5) ysize(6)
		graph export `Figure_A4_1_1', as(png) name("Graph") replace

		
/* Figure A4.2.1: Mean Fairness Assessment by Education and Political Leaning 
------------------------------------------------------------------------------- */
	
	*** Part a - Conservative ***

	preserve 

		keep if conserv == 1 & stage_one == 1

		gen edu_num = (education_hs_2year == 1)
		replace edu_num = 2 if education_four_college == 1
		replace edu_num = 3 if education_higher == 1

			* Obtain CIs for the figure 
			mean fair if edu_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if edu_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)
	
			mean fair if edu_num == 3, cluster(randomid)
			
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]	
				loc		  	 N_3 = e(N)
				

		** footnotes
		qui reg fair education_hs_2year if edu_num != 3, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "HS/2-year vs. 4-year College, p = `P_VALUE'."
		// p = .304
		
		qui reg fair education_four_college if edu_num != 1, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "4-year College vs. Grad School, p = `P_VALUE'."		
		// p = .199
		
		qui reg fair education_higher if edu_num != 2, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "Grad School vs. HS/2-year College, p = `P_VALUE'."
		// p = .056

		collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(edu_num)

				gen 	 hifair = hifair_1 if edu_num == 1
				replace  hifair = hifair_2 if edu_num == 2
				replace  hifair = hifair_3 if edu_num == 3

				gen		 lowfair = lowfair_1 if edu_num == 1
				replace  lowfair = lowfair_2 if edu_num == 2
				replace  lowfair = lowfair_3 if edu_num == 3

				assert n == `N_1' if edu_num == 1
				assert n == `N_2' if edu_num == 2
				assert n == `N_3' if edu_num == 3

		gen x = edu_num if edu_num == 1
		replace x = edu_num + 0.25 if edu_num == 2
		replace x = edu_num + 0.50 if edu_num == 3

		sort x

		#d;
		graph twoway 
			(bar meanfair x if edu_num == 1, color(cranberry*.55)) 
			(bar meanfair x if edu_num == 2, color(cranberry*.55)) 
			(bar meanfair x if edu_num == 3, color(cranberry*.55)) 
			(scatter meanfair x if edu_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
			(scatter meanfair x if edu_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
			(scatter meanfair x if edu_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
			(rcap hifair lowfair x,lcolor(black))
			, legend(off) 
			xlabel(1 `" "HS/2-year" "College" "' 2.25 `" "4-year" "College" "' 3.50 "Grad School") xtitle("") 
			ysc(r(-1.5 1.5)) ylabel(-1(1)1, grid format(%4.1f)) yline(0) ytitle("Mean Fairness Evaluation") 
			title("(a)", size(medium)) subtitle("Conservative Respondents")
			note("Num. obs. are `N_1', `N_2', and `N_3', respectively.")
		;
		#d cr
		graph save "$FIG_TMP/education_conservative.gph", replace

	restore
	

	*** Part b - Moderate ***

	preserve 

		keep if mod == 1 & stage_one == 1

		gen edu_num = (education_hs_2year == 1)
		replace edu_num = 2 if education_four_college == 1
		replace edu_num = 3 if education_higher == 1

			* Obtain CIs for the figure 
			mean fair if edu_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if edu_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)
	
			mean fair if edu_num == 3, cluster(randomid)
			
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]	
				loc		  	 N_3 = e(N)
				

		** footnotes
		qui reg fair education_hs_2year if edu_num != 3, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "HS/2-year vs. 4-year College, p = `P_VALUE'."
		// p = .032
		
		qui reg fair education_four_college if edu_num != 1, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "4-year College vs. Grad School, p = `P_VALUE'."		
		// p = .564
		
		qui reg fair education_higher if edu_num != 2, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "Grad School vs. HS/2-year College, p = `P_VALUE'."
		// p = .457

		collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(edu_num)

				gen 	 hifair = hifair_1 if edu_num == 1
				replace  hifair = hifair_2 if edu_num == 2
				replace  hifair = hifair_3 if edu_num == 3

				gen		 lowfair = lowfair_1 if edu_num == 1
				replace  lowfair = lowfair_2 if edu_num == 2
				replace  lowfair = lowfair_3 if edu_num == 3

				assert n == `N_1' if edu_num == 1
				assert n == `N_2' if edu_num == 2
				assert n == `N_3' if edu_num == 3

		gen x = edu_num if edu_num == 1
		replace x = edu_num + 0.25 if edu_num == 2
		replace x = edu_num + 0.50 if edu_num == 3

		sort x

		#d;
		graph twoway 
			(bar meanfair x if edu_num == 1, color(cranberry*.55)) 
			(bar meanfair x if edu_num == 2, color(cranberry*.55)) 
			(bar meanfair x if edu_num == 3, color(cranberry*.55)) 
			(scatter meanfair x if edu_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(scatter meanfair x if edu_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(scatter meanfair x if edu_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(rcap hifair lowfair x,lcolor(black))
			, legend(off) 
			xlabel(1 `" "HS/2-year" "College" "' 2.25 `" "4-year" "College" "' 3.50 "Grad School") xtitle("") 
			ysc(r(-1.5 1.5)) ylabel(-1(1)1, grid format(%4.1f)) yline(0) ytitle("Mean Fairness Evaluation") 
			title("(a)", size(medium)) subtitle("Moderate Respondents")
			note("Num. obs. are `N_1', `N_2', and `N_3', respectively.")
		;
		#d cr

		graph save "$FIG_TMP/education_moderate.gph", replace


	restore


	*** Part c - Liberal ***

	preserve 

		keep if lib == 1 & stage_one == 1

		gen edu_num = (education_hs_2year == 1)
		replace edu_num = 2 if education_four_college == 1
		replace edu_num = 3 if education_higher == 1

			* Obtain CIs for the figure 
			mean fair if edu_num == 1, cluster(randomid)
		
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if edu_num == 2, cluster(randomid)
			
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)
	
			mean fair if edu_num == 3, cluster(randomid)
			
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]	
				loc		  	 N_3 = e(N)
				

		** footnotes
		qui reg fair education_hs_2year if edu_num != 3, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "HS/2-year vs. 4-year College, p = `P_VALUE'."
		// p = .001
		
		qui reg fair education_four_college if edu_num != 1, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "4-year College vs. Grad School, p = `P_VALUE'."		
		// p = .974
		
		qui reg fair education_higher if edu_num != 2, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "Grad School vs. HS/2-year College, p = `P_VALUE'."
		// p = .008

		collapse (mean) meanfair = fair (sd) sdfair = fair (count) n=fair, by(edu_num)

				gen 	 hifair = hifair_1 if edu_num == 1
				replace  hifair = hifair_2 if edu_num == 2
				replace  hifair = hifair_3 if edu_num == 3

				gen		 lowfair = lowfair_1 if edu_num == 1
				replace  lowfair = lowfair_2 if edu_num == 2
				replace  lowfair = lowfair_3 if edu_num == 3

				assert n == `N_1' if edu_num == 1
				assert n == `N_2' if edu_num == 2
				assert n == `N_3' if edu_num == 3

		gen x = edu_num if edu_num == 1
		replace x = edu_num + 0.25 if edu_num == 2
		replace x = edu_num + 0.50 if edu_num == 3

		sort x

		#d;
		graph twoway 
			(bar meanfair x if edu_num == 1, color(cranberry*.55)) 
			(bar meanfair x if edu_num == 2, color(cranberry*.55)) 
			(bar meanfair x if edu_num == 3, color(cranberry*.55)) 
			(scatter meanfair x if edu_num == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(scatter meanfair x if edu_num == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(scatter meanfair x if edu_num == 3, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(rcap hifair lowfair x,lcolor(black))
			, legend(off) 
			xlabel(1 `" "HS/2-year" "College" "' 2.25 `" "4-year" "College" "' 3.50 "Grad School") xtitle("") 
			ysc(r(-1.5 1.5)) ylabel(-1(1)1, grid format(%4.1f)) yline(0) ytitle("Mean Fairness Evaluation") 
			title("(a)", size(medium)) subtitle("Liberal Respondents")
			note("Num. obs. are `N_1', `N_2', and `N_3', respectively.")
		;
		#d cr

		graph save "$FIG_TMP/education_liberal.gph", replace

	restore

	*** Parts a-c: combining

	graph combine "$FIG_TMP/education_conservative.gph" "$FIG_TMP/education_moderate.gph" "$FIG_TMP/education_liberal.gph"

	graph export `Figure_A4_2_1', as(png) name("Graph") replace 


	
/* Figure A4.2.2: Discriminatee Race Effects by Education 
------------------------------------------------------------------------------- */		
preserve 

	keep if stage_one == 1

	gen edu_num = (education_hs_2year == 1)
	replace edu_num = 2 if education_four_colleg == 1
	replace edu_num = 3 if education_higher == 1

	gen treat = 1 if black == 1
	replace treat = 2 if black == 0
	
		* Obtain CIs for the figure 
		mean fair if treat == 1 & edu_num == 1, cluster(randomid)
			scalar  hifair_1 = r(table)["ul", "fair"]
			scalar lowfair_1 = r(table)["ll", "fair"]
			loc		  	 N_1 = e(N)
			
		mean fair if treat == 2 & edu_num == 1, cluster(randomid)		
			scalar  hifair_2 = r(table)["ul", "fair"]
			scalar lowfair_2 = r(table)["ll", "fair"]	
			loc		  	 N_2 = e(N)

		mean fair if treat == 1 & edu_num == 2, cluster(randomid)		
			scalar  hifair_3 = r(table)["ul", "fair"]
			scalar lowfair_3 = r(table)["ll", "fair"]	
			loc		  	 N_3 = e(N)
		
		mean fair if treat == 2 & edu_num == 2, cluster(randomid)
			scalar  hifair_4 = r(table)["ul", "fair"]
			scalar lowfair_4 = r(table)["ll", "fair"]	
			loc		  	 N_4 = e(N)
		
		mean fair if treat == 1 & edu_num == 3, cluster(randomid)
			scalar  hifair_5 = r(table)["ul", "fair"]
			scalar lowfair_5 = r(table)["ll", "fair"]	
			loc		  	 N_5 = e(N)
			
		mean fair if treat == 2 & edu_num == 3, cluster(randomid)
			scalar  hifair_6 = r(table)["ul", "fair"]
			scalar lowfair_6 = r(table)["ll", "fair"]	
			loc		  	 N_6 = e(N)
	
	** footnotes
		qui reg fair black if edu_num == 1, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For HS/2-yar College graduates: Black vs. White, p = `P_VALUE'."
		// p = .032
		
		qui reg fair black if edu_num == 2, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."		
		// p = .021
		
		qui reg fair black if edu_num == 3, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."
		// p = .016
			
	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(edu_num treat)
	
				gen 	 hifair = hifair_1 if treat == 1 & edu_num == 1
				replace  hifair = hifair_2 if treat == 2 & edu_num == 1
				replace  hifair = hifair_3 if treat == 1 & edu_num == 2
				replace  hifair = hifair_4 if treat == 2 & edu_num == 2
				replace  hifair = hifair_5 if treat == 1 & edu_num == 3
				replace  hifair = hifair_6 if treat == 2 & edu_num == 3

				gen		 lowfair = lowfair_1 if treat == 1 & edu_num == 1
				replace  lowfair = lowfair_2 if treat == 2 & edu_num == 1
				replace  lowfair = lowfair_3 if treat == 1 & edu_num == 2
				replace  lowfair = lowfair_4 if treat == 2 & edu_num == 2
				replace  lowfair = lowfair_5 if treat == 1 & edu_num == 3
				replace  lowfair = lowfair_6 if treat == 2 & edu_num == 3

				assert n == `N_1' if treat == 1 & edu_num == 1
				assert n == `N_2' if treat == 2 & edu_num == 1
				assert n == `N_3' if treat == 1 & edu_num == 2
				assert n == `N_4' if treat == 2 & edu_num == 2
				assert n == `N_5' if treat == 1 & edu_num == 3
				assert n == `N_6' if treat == 2 & edu_num == 3

	gen edutreat = treat if edu_num  == 1
	replace edutreat = treat + 2.5 if edu_num  == 2
	replace edutreat = treat + 5 if edu_num  == 3

	#d;
		graph twoway 
		(bar meanfair edutreat if treat == 1, color(cranberry*.55)) 
			(bar meanfair edutreat if treat == 2, lwidth(thick) lc(eltblue) fc(eltblue*0.50%20) lpattern(dash)) 
		(scatter meanfair edutreat if treat == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(scatter meanfair edutreat if treat == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(rcap hifair lowfair edutreat,lcolor(black))
		, legend(row(1) order(1 "Black" 2 "White")) 
		xlabel(1.5 `" "HS/2-year" "College" "' 4 `" "4-year" "College" "' 6.5 "Grad School") xtitle("") 
		yscale(r(-1.3 1.0)) ylabel(-1.0 -0.5 0 0.5 1.0, grid format(%4.1f)) yline(0) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1', `N_2', `N_3', `N_4', `N_5', and `N_6', respectively.")
	;
	#d cr

	graph export `Figure_A4_2_2', as(png) name("Graph") replace

restore
	
	
/* Figure A4.2.3: Discriminatee Race Effects by Education and Political Leaning
------------------------------------------------------------------------------- */	
		
	*** Part a - Conservative ***

	preserve 

		keep if conserv == 1 & stage_one == 1

		gen edu_num = (education_hs_2year == 1)
		replace edu_num = 2 if education_four_colleg == 1
		replace edu_num = 3 if education_higher == 1

		gen treat = 1 if black == 1
		replace treat = 2 if black == 0

			* Obtain CIs for the figure 
			mean fair if treat == 1 & edu_num == 1, cluster(randomid)
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if treat == 2 & edu_num == 1, cluster(randomid)		
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if treat == 1 & edu_num == 2, cluster(randomid)		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]	
				loc		  	 N_3 = e(N)
			
			mean fair if treat == 2 & edu_num == 2, cluster(randomid)
				scalar  hifair_4 = r(table)["ul", "fair"]
				scalar lowfair_4 = r(table)["ll", "fair"]	
				loc		  	 N_4 = e(N)
			
			mean fair if treat == 1 & edu_num == 3, cluster(randomid)
				scalar  hifair_5 = r(table)["ul", "fair"]
				scalar lowfair_5 = r(table)["ll", "fair"]	
				loc		  	 N_5 = e(N)
				
			mean fair if treat == 2 & edu_num == 3, cluster(randomid)
				scalar  hifair_6 = r(table)["ul", "fair"]
				scalar lowfair_6 = r(table)["ll", "fair"]	
				loc		  	 N_6 = e(N)
	
				

		** footnotes
		qui reg fair black if edu_num == 1, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For HS/2-yar College graduates: Black vs. White, p = `P_VALUE'."
		// p = .154
		
		qui reg fair black if edu_num == 2, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."		
		// p = .544
		
		qui reg fair black if edu_num == 3, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."
		// p = .765


		collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(edu_num treat)
	
				gen 	 hifair = hifair_1 if treat == 1 & edu_num == 1
				replace  hifair = hifair_2 if treat == 2 & edu_num == 1
				replace  hifair = hifair_3 if treat == 1 & edu_num == 2
				replace  hifair = hifair_4 if treat == 2 & edu_num == 2
				replace  hifair = hifair_5 if treat == 1 & edu_num == 3
				replace  hifair = hifair_6 if treat == 2 & edu_num == 3

				gen		 lowfair = lowfair_1 if treat == 1 & edu_num == 1
				replace  lowfair = lowfair_2 if treat == 2 & edu_num == 1
				replace  lowfair = lowfair_3 if treat == 1 & edu_num == 2
				replace  lowfair = lowfair_4 if treat == 2 & edu_num == 2
				replace  lowfair = lowfair_5 if treat == 1 & edu_num == 3
				replace  lowfair = lowfair_6 if treat == 2 & edu_num == 3

				assert n == `N_1' if treat == 1 & edu_num == 1
				assert n == `N_2' if treat == 2 & edu_num == 1
				assert n == `N_3' if treat == 1 & edu_num == 2
				assert n == `N_4' if treat == 2 & edu_num == 2
				assert n == `N_5' if treat == 1 & edu_num == 3
				assert n == `N_6' if treat == 2 & edu_num == 3

		gen edutreat = treat if edu_num  == 1
		replace edutreat = treat + 2.5 if edu_num  == 2
		replace edutreat = treat + 5 if edu_num  == 3

		#d;
			graph twoway 
			(bar meanfair edutreat if treat == 1, color(cranberry*.55)) 
			(bar meanfair edutreat if treat == 2, lwidth(thick) lc(eltblue) fc(eltblue*0.50%20) lpattern(dash)) 
			(scatter meanfair edutreat if treat == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
			(scatter meanfair edutreat if treat == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
			(rcap hifair lowfair edutreat, lcolor(black))
			, legend(row(1) order(1 "Black" 2 "White") size(vsmall)) 
			xlabel(1.5 `" "HS/2-year" "College" "' 4 `" "4-year" "College" "' 6.5 "Grad School") xtitle("") 
			yscale(r(-2.25 2)) ylabel(-2(1)2, grid format(%4.0f)) yline(0) ytitle("Mean Fairness Evaluation")
			title("(a)", size(medium)) subtitle("Conservative Respondents")
			note("Num. obs. are `N_1', `N_2', `N_3', `N_4', `N_5', and `N_6', respectively.")

		;
		#d cr

		graph save "$FIG_TMP/race_conservative.gph", replace

	restore


	*** Part b - Moderate ***

	preserve 

		keep if mod == 1 & stage_one == 1

		gen edu_num = (education_hs_2year == 1)
		replace edu_num = 2 if education_four_colleg == 1
		replace edu_num = 3 if education_higher == 1

		gen treat = 1 if black == 1
		replace treat = 2 if black == 0

			* Obtain CIs for the figure 
			mean fair if treat == 1 & edu_num == 1, cluster(randomid)
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if treat == 2 & edu_num == 1, cluster(randomid)		
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if treat == 1 & edu_num == 2, cluster(randomid)		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]	
				loc		  	 N_3 = e(N)
			
			mean fair if treat == 2 & edu_num == 2, cluster(randomid)
				scalar  hifair_4 = r(table)["ul", "fair"]
				scalar lowfair_4 = r(table)["ll", "fair"]	
				loc		  	 N_4 = e(N)
			
			mean fair if treat == 1 & edu_num == 3, cluster(randomid)
				scalar  hifair_5 = r(table)["ul", "fair"]
				scalar lowfair_5 = r(table)["ll", "fair"]	
				loc		  	 N_5 = e(N)
				
			mean fair if treat == 2 & edu_num == 3, cluster(randomid)
				scalar  hifair_6 = r(table)["ul", "fair"]
				scalar lowfair_6 = r(table)["ll", "fair"]	
				loc		  	 N_6 = e(N)
	
				

		** footnotes
		qui reg fair black if edu_num == 1, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For HS/2-yar College graduates: Black vs. White, p = `P_VALUE'."
		// p = .029
		
		qui reg fair black if edu_num == 2, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."		
		// p = .028
		
		qui reg fair black if edu_num == 3, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."
		// p = .107

		collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(edu_num treat)
	
				gen 	 hifair = hifair_1 if treat == 1 & edu_num == 1
				replace  hifair = hifair_2 if treat == 2 & edu_num == 1
				replace  hifair = hifair_3 if treat == 1 & edu_num == 2
				replace  hifair = hifair_4 if treat == 2 & edu_num == 2
				replace  hifair = hifair_5 if treat == 1 & edu_num == 3
				replace  hifair = hifair_6 if treat == 2 & edu_num == 3

				gen		 lowfair = lowfair_1 if treat == 1 & edu_num == 1
				replace  lowfair = lowfair_2 if treat == 2 & edu_num == 1
				replace  lowfair = lowfair_3 if treat == 1 & edu_num == 2
				replace  lowfair = lowfair_4 if treat == 2 & edu_num == 2
				replace  lowfair = lowfair_5 if treat == 1 & edu_num == 3
				replace  lowfair = lowfair_6 if treat == 2 & edu_num == 3

				assert n == `N_1' if treat == 1 & edu_num == 1
				assert n == `N_2' if treat == 2 & edu_num == 1
				assert n == `N_3' if treat == 1 & edu_num == 2
				assert n == `N_4' if treat == 2 & edu_num == 2
				assert n == `N_5' if treat == 1 & edu_num == 3
				assert n == `N_6' if treat == 2 & edu_num == 3

		gen edutreat = treat if edu_num  == 1
		replace edutreat = treat + 2.5 if edu_num  == 2
		replace edutreat = treat + 5 if edu_num  == 3

		#d;
			graph twoway 
			(bar meanfair edutreat if treat == 1, color(cranberry*.55)) 
			(bar meanfair edutreat if treat == 2, lwidth(thick) lc(eltblue) fc(eltblue*0.50%20) lpattern(dash)) 
			(scatter meanfair edutreat if treat == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(scatter meanfair edutreat if treat == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(rcap hifair lowfair edutreat,lcolor(black))
			, legend(off) 
			xlabel(1.5 `" "HS/2-year" "College" "' 4 `" "4-year" "College" "' 6.5 "Grad School") xtitle("") 
			yscale(r(-2.25 2)) ylabel(-2(1)2, grid format(%4.0f)) yline(0) ytitle("Mean Fairness Evaluation")
			title("(b)", size(medium)) subtitle("Moderate Respondents")
			note("Num. obs. are `N_1', `N_2', `N_3', `N_4', `N_5', and `N_6', respectively.")

		;
		#d cr

		graph save "$FIG_TMP/race_moderate.gph", replace

	restore

	*** Part c - Liberal ***

	preserve 

		keep if lib == 1 & stage_one == 1

		gen edu_num = (education_hs_2year == 1)
		replace edu_num = 2 if education_four_colleg == 1
		replace edu_num = 3 if education_higher == 1

		gen treat = 1 if black == 1
		replace treat = 2 if black == 0

			* Obtain CIs for the figure 
			mean fair if treat == 1 & edu_num == 1, cluster(randomid)
				scalar  hifair_1 = r(table)["ul", "fair"]
				scalar lowfair_1 = r(table)["ll", "fair"]
				loc		  	 N_1 = e(N)
				
			mean fair if treat == 2 & edu_num == 1, cluster(randomid)		
				scalar  hifair_2 = r(table)["ul", "fair"]
				scalar lowfair_2 = r(table)["ll", "fair"]	
				loc		  	 N_2 = e(N)

			mean fair if treat == 1 & edu_num == 2, cluster(randomid)		
				scalar  hifair_3 = r(table)["ul", "fair"]
				scalar lowfair_3 = r(table)["ll", "fair"]	
				loc		  	 N_3 = e(N)
			
			mean fair if treat == 2 & edu_num == 2, cluster(randomid)
				scalar  hifair_4 = r(table)["ul", "fair"]
				scalar lowfair_4 = r(table)["ll", "fair"]	
				loc		  	 N_4 = e(N)
			
			mean fair if treat == 1 & edu_num == 3, cluster(randomid)
				scalar  hifair_5 = r(table)["ul", "fair"]
				scalar lowfair_5 = r(table)["ll", "fair"]	
				loc		  	 N_5 = e(N)
				
			mean fair if treat == 2 & edu_num == 3, cluster(randomid)
				scalar  hifair_6 = r(table)["ul", "fair"]
				scalar lowfair_6 = r(table)["ll", "fair"]	
				loc		  	 N_6 = e(N)
	
				

		** footnotes
		qui reg fair black if edu_num == 1, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For HS/2-yar College graduates: Black vs. White, p = `P_VALUE'."
		// p = .001
		
		qui reg fair black if edu_num == 2, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."		
		// p = .043
		
		qui reg fair black if edu_num == 3, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]
		di "For 4-year College graduates: Black vs. White, p = `P_VALUE'."
		// p = .009


		collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(edu_num treat)
	
				gen 	 hifair = hifair_1 if treat == 1 & edu_num == 1
				replace  hifair = hifair_2 if treat == 2 & edu_num == 1
				replace  hifair = hifair_3 if treat == 1 & edu_num == 2
				replace  hifair = hifair_4 if treat == 2 & edu_num == 2
				replace  hifair = hifair_5 if treat == 1 & edu_num == 3
				replace  hifair = hifair_6 if treat == 2 & edu_num == 3

				gen		 lowfair = lowfair_1 if treat == 1 & edu_num == 1
				replace  lowfair = lowfair_2 if treat == 2 & edu_num == 1
				replace  lowfair = lowfair_3 if treat == 1 & edu_num == 2
				replace  lowfair = lowfair_4 if treat == 2 & edu_num == 2
				replace  lowfair = lowfair_5 if treat == 1 & edu_num == 3
				replace  lowfair = lowfair_6 if treat == 2 & edu_num == 3

				assert n == `N_1' if treat == 1 & edu_num == 1
				assert n == `N_2' if treat == 2 & edu_num == 1
				assert n == `N_3' if treat == 1 & edu_num == 2
				assert n == `N_4' if treat == 2 & edu_num == 2
				assert n == `N_5' if treat == 1 & edu_num == 3
				assert n == `N_6' if treat == 2 & edu_num == 3

		gen edutreat = treat if edu_num  == 1
		replace edutreat = treat + 2.5 if edu_num  == 2
		replace edutreat = treat + 5 if edu_num  == 3

		#d;
			graph twoway 
			(bar meanfair edutreat if treat == 1, color(cranberry*.55)) 
			(bar meanfair edutreat if treat == 2, lwidth(thick) lc(eltblue) fc(eltblue*0.50%20) lpattern(dash)) 
			(scatter meanfair edutreat if treat == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(scatter meanfair edutreat if treat == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
			(rcap hifair lowfair edutreat,lcolor(black))
			, legend(off) 
			xlabel(1.5 `" "HS/2-year" "College" "' 4 `" "4-year" "College" "' 6.5 "Grad School") xtitle("") 
			yscale(r(-2.25 2)) ylabel(-2(1)2, grid format(%4.0f)) yline(0) ytitle("Mean Fairness Evaluation")
			title("(c)", size(medium)) subtitle("Liberal Respondents")
			note("Num. obs. are `N_1', `N_2', `N_3', `N_4', `N_5', and `N_6', respectively.")

		;
		#d cr

		graph save "$FIG_TMP/race_liberal.gph", replace
		
	restore	
	
	*** Parts a-c: combining

	grc1leg "$FIG_TMP/race_conservative.gph" "$FIG_TMP/race_moderate.gph" "$FIG_TMP/race_liberal.gph", legendfrom("$FIG_TMP/race_conservative.gph")

	graph export `Figure_A4_2_3', as(png) name("Graph") replace
		
	
		
/* ******************************** Appendix 5 ******************************** */	

		
/* Figure A5.3: Replicates Figure 1: Using Three Political Groups
------------------------------------------------------------------------------- */
	* Panel (a) - Anti-Black
	preserve

		keep if black==1

		keep if stage_one == 1

				reg fair bro if conserv==1, cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)

				reg fair bro if mod==1, cluster(randomid)
				loc b_mod: di %6.3f _b[bro]
				loc p_mod: di %6.3f r(table)[4,1] 
				loc N_mod= e(N)

				reg fair bro if lib==1, cluster(randomid)
				loc b_lib: di %6.3f _b[bro]
				loc p_lib: di %6.3f r(table)[4,1] 
				loc N_lib= e(N)

				* Test of equality for both coefficients
				reg fair bro if conserv == 1
				est store bbu_con
				reg fair bro if mod==1
				est store bbu_mod
				reg fair bro if lib==1
				est store bbu_lib

				suest bbu_con bbu_mod bbu_lib, cluster(randomid)

				test[bbu_con_mean]bro = [bbu_mod_mean]bro = [bbu_lib_mean]bro 
				* p = 0.0035

		collapse (mean) fair (count) n=randomid, by(bro conserv mod lib)

		gen fair_con = fair if conserv==1
		gen fair_mod = fair if mod==1
		gen fair_lib = fair if lib==1

		qui reg fair_con bro [fw=n]
			predict fair_con_hat
		qui reg fair_mod bro [fw=n]
			predict fair_mod_hat
		qui reg fair_lib bro [fw=n]
			predict fair_lib_hat

			
		#delim;
			twoway 
			(scatter fair_con_hat bro [w=n]	, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_con     bro [w=n]	, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_lib_hat bro [w=n]	, s(i) c(l) lcolor(green)  lwidth(thick) 	lpattern(shortdash_dot))
			(scatter fair_lib     bro [w=n]	, m(Sh)		mlcolor(green) mlwidth(medthick)) 
			(scatter fair_mod_hat bro [w=n]	, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_mod     bro [w=n]	, m(Th)		mlcolor(navy) mlwidth(medthick)) 			
			(scatteri 2.9 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)   mlabsize(small))
			(scatteri 2.7 -4 (3) "Liberals: slope=`b_lib', p=`p_lib'"		, ms(none) mlabcolor(green) mlabsize(small))
			(scatteri 2.5 -4 (3) "Moderates: slope=`b_mod', p=`p_mod'"		, ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			
			yscale(r(-2.5 3)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(a)") subtitle("Anti-Black Discrimination") xtitle("BRO Measure") ytitle("Mean Fairness Assessment") 
			legend(	row(3) size(vsmall)
					order(- "Conservatives:" 		1 "Predicted" 2 "Obs" 
						  - "Liberals:" 			3 "Predicted" 4 "Obs" 
						  - "Moderates:" 			5 "Predicted" 6 "Obs" 
						  )) 
			note("Conservatives: N=`N_cons',  Liberals: N=`N_lib', Moderates: N=`N_mod'")
				;
		#delim cr	
		
		graph save "$FIG_TMP/Figure_a5_3a.gph", replace

	restore
	

	* Panel (b) - Anti-White
	preserve

		keep if black==0

		keep if stage_one == 1

				reg fair bro if conserv==1, cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)

				reg fair bro if mod==1, cluster(randomid)
				loc b_mod: di %6.3f _b[bro]
				loc p_mod: di %6.3f r(table)[4,1] 
				loc N_mod= e(N)

				reg fair bro if lib==1, cluster(randomid)
				loc b_lib: di %6.3f _b[bro]
				loc p_lib: di %6.3f r(table)[4,1] 
				loc N_lib= e(N)

				* Test of equality for both coefficients
				reg fair bro if conserv == 1
				est store bbu_con
				reg fair bro if mod==1
				est store bbu_mod
				reg fair bro if lib==1
				est store bbu_lib

				suest bbu_con bbu_mod bbu_lib, cluster(randomid)

				test[bbu_con_mean]bro = [bbu_mod_mean]bro = [bbu_lib_mean]bro 
				* p = 0.0035

		collapse (mean) fair (count) n=randomid, by(bro conserv mod lib)

		gen fair_con = fair if conserv==1
		gen fair_mod = fair if mod==1
		gen fair_lib = fair if lib==1

		qui reg fair_con bro [fw=n]
			predict fair_con_hat
		qui reg fair_mod bro [fw=n]
			predict fair_mod_hat
		qui reg fair_lib bro [fw=n]
			predict fair_lib_hat

		#delim;
			twoway 
			(scatter fair_con_hat bro [w=n]	, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_con     bro [w=n]	, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_lib_hat bro [w=n]	, s(i) c(l) lcolor(green)  lwidth(thick) 	lpattern(shortdash_dot))
			(scatter fair_lib     bro [w=n]	, m(Sh)		mlcolor(green) mlwidth(medthick)) 
			(scatter fair_mod_hat bro [w=n]	, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_mod     bro [w=n]	, m(Th)		mlcolor(navy) mlwidth(medthick)) 			
			(scatteri 2.9 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)   mlabsize(small))
			(scatteri 2.7 -4 (3) "Liberals: slope=`b_lib', p=`p_lib'"		, ms(none) mlabcolor(green) mlabsize(small))
			(scatteri 2.5 -4 (3) "Moderates: slope=`b_mod', p=`p_mod'"		, ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2.5 3)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(b)") subtitle("Anti-White Discrimination") xtitle("BRO Measure") 
			legend(	row(3) size(vsmall)
					order(- "Conservatives:" 		1 "Predicted" 2 "Obs" 
						  - "Liberals:" 			3 "Predicted" 4 "Obs" 
						  - "Moderates:" 			5 "Predicted" 6 "Obs" 
						  )) 
			note("Conservatives: N=`N_cons',  Liberals: N=`N_lib', Moderates: N=`N_mod'")
				;
		#delim cr	
		graph save "$FIG_TMP/Figure_a5_3b.gph", replace

	restore 

	
	* Combine (a) and (b)
	
	grc1leg "$FIG_TMP/Figure_a5_3a.gph" "$FIG_TMP/Figure_a5_3b.gph", xsize(8) ysize(5) legendfrom("$FIG_TMP/Figure_a5_3a.gph")
	graph export "`Figure_A5_3'", as(png) name("Graph") replace
	



/* ******************************** Appendix 7 ******************************** */

/* Figure A7.1.1: Mean BRO Evaluation Across Respondents' Survey Experience
------------------------------------------------------------------------------- */

preserve

	gen experience = 1 if black_only == 1
	replace experience = 2 if switcher == 1
	replace experience = 3 if white_only == 1
	
	* Obtain CIs for the figure 
	mean bro if experience == 1, cluster(randomid)

		scalar  hibro_1 = r(table)["ul", "bro"]
		scalar lowbro_1 = r(table)["ll", "bro"]
		loc		  	 N_1 = e(N)
		
	mean bro if experience == 2, cluster(randomid)
	
		scalar  hibro_2 = r(table)["ul", "bro"]
		scalar lowbro_2 = r(table)["ll", "bro"]	
		loc		  	 N_2 = e(N)

	mean bro if experience == 3, cluster(randomid)

		scalar  hibro_3 = r(table)["ul", "bro"]
		scalar lowbro_3 = r(table)["ll", "bro"]
		loc		  	 N_3 = e(N)
				
	* Obtain p-values
	qui reg bro black_only if white_only == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .938
	di "Black Treatment in Both Stages vs Switchers = `P_VALUE'."

	qui reg bro switcher if black_only == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .624
	di "Switchers vs White Treatment in Both Stages = `P_VALUE'."

	qui reg bro white_only if switcher == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .655
	di "Black Treatment in Both Stages vs White Treatment in Both Stages = `P_VALUE'."

	collapse (mean) meanbro = bro (sd) sdbro = bro (count) n=bro, by(experience)

				gen 	 hibro = hibro_1 if experience == 1
				replace  hibro = hibro_2 if experience == 2
				replace  hibro = hibro_3 if experience == 3
		
				gen		 lowbro = lowbro_1 if experience == 1
				replace  lowbro = lowbro_2 if experience == 2
				replace  lowbro = lowbro_3 if experience == 3
				
				assert n == `N_1' if experience == 1
				assert n == `N_2' if experience == 2
				assert n == `N_3' if experience == 3				
			
	gen x = experience if experience == 1
	replace x = experience + 0.25 if experience == 2
	replace x = experience + 0.50 if experience == 3
	
	sort x

	#d;
		graph twoway 
		(bar meanbro x if experience == 1, color(cranberry*.55)) 
		(bar meanbro x if experience == 2, color(cranberry*.55)) 
		(bar meanbro x if experience == 3, color(cranberry*.55)) 
		(scatter meanbro x if experience == 1, msymbol(none) mlabcolor(black) mlabel(meanbro) mlabformat(%4.2f) mlabposition(4))
		(scatter meanbro x if experience == 2, msymbol(none) mlabcolor(black) mlabel(meanbro) mlabformat(%4.2f) mlabposition(4))
		(scatter meanbro x if experience == 3, msymbol(none) mlabcolor(black) mlabel(meanbro) mlabformat(%4.2f) mlabposition(4))
		(rcap hibro lowbro x,lcolor(black))
		, legend(off) 
		xlabel(1 `" "Black Treatment in" "Both Stages" "' 2.25 `" "Switch Treatments" "Between Stages" "' 3.50 `" "White Treatment in" "Both Stages" "') xtitle("") 
		ylab(-1.5 -1 -0.5 0, grid format(%4.1f)) yscale(r(0 -0.5)) yline(0) ytitle("Mean BRO Evaluation")
		note("Num. obs. are `N_1', `N_2', and `N_3', respectively.")
	;
	#d cr
	
	graph export `Figure_A7_1_1', as(png) name("Graph") replace

restore 


/* Figure A7.1.2: Mean Political Leaning Across Respondents' Survey Experience
------------------------------------------------------------------------------- */

preserve

	gen leanings = 0 

	replace leanings = 1 if spectrum == "Extremely conservative"
	replace leanings = 2 if spectrum == "Conservative"
	replace leanings = 3 if spectrum == "Slightly Conservative"
	replace leanings = 4 if spectrum == "Moderate"
	replace leanings = 5 if spectrum == "Slightly liberal"
	replace leanings = 6 if spectrum == "Liberal"
	replace leanings = 7 if spectrum == "Extremely liberal"

	replace leanings = leanings - 4

	* Obtain p-values
	qui reg leanings black_only if white_only == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .471
	di "Black Treatment in Both Stages vs Switchers = `P_VALUE'."

	qui reg leanings switcher if black_only == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .758
	di "Switchers vs White Treatment in Both Stages = `P_VALUE'."

	qui reg leanings white_only if switcher == 0, cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .737
	di "Black Treatment in Both Stages vs White Treatment in Both Stages = `P_VALUE'."
	
	gen experience = 1 if black_only == 1
	replace experience = 2 if switcher == 1
	replace experience = 3 if white_only == 1
	
	* Obtain CIs for the figure 
	mean leanings if experience == 1, cluster(randomid)

		scalar  hileanings_1 = r(table)["ul", "leanings"]
		scalar lowleanings_1 = r(table)["ll", "leanings"]
		loc		  	 N_1 = e(N)
		
	mean leanings if experience == 2, cluster(randomid)
	
		scalar  hileanings_2 = r(table)["ul", "leanings"]
		scalar lowleanings_2 = r(table)["ll", "leanings"]	
		loc		  	 N_2 = e(N)

	mean leanings if experience == 3, cluster(randomid)

		scalar  hileanings_3 = r(table)["ul", "leanings"]
		scalar lowleanings_3 = r(table)["ll", "leanings"]
		loc		  	 N_3 = e(N)
				

	collapse (mean) meanleanings = leanings (sd) sdleanings = leanings (count) n=leanings, by(experience)

				gen 	 hileanings = hileanings_1 if experience == 1
				replace  hileanings = hileanings_2 if experience == 2
				replace  hileanings = hileanings_3 if experience == 3
		
				gen		 lowleanings = lowleanings_1 if experience == 1
				replace  lowleanings = lowleanings_2 if experience == 2
				replace  lowleanings = lowleanings_3 if experience == 3
				
				assert n == `N_1' if experience == 1
				assert n == `N_2' if experience == 2
				assert n == `N_3' if experience == 3	

	gen x = experience if experience == 1
	replace x = experience + 0.25 if experience == 2
	replace x = experience + 0.50 if experience == 3
	
	sort x

	#d;
		graph twoway 
		(bar meanleanings x if experience == 1, color(cranberry*.55)) 
		(bar meanleanings x if experience == 2, color(cranberry*.55)) 
		(bar meanleanings x if experience == 3, color(cranberry*.55)) 
		(scatter meanleanings x if experience == 1, msymbol(none) mlabcolor(black) mlabel(meanleanings) mlabformat(%4.2f) mlabposition(2))
		(scatter meanleanings x if experience == 2, msymbol(none) mlabcolor(black) mlabel(meanleanings) mlabformat(%4.2f) mlabposition(2))
		(scatter meanleanings x if experience == 3, msymbol(none) mlabcolor(black) mlabel(meanleanings) mlabformat(%4.2f) mlabposition(2))
		(rcap hileanings lowleanings x,lcolor(black))
		, legend(off) 
		xlabel(1 `" "Black Treatment in" "Both Stages" "' 2.25 `" "Switch Treatments" "Between Stages" "' 3.50 `" "White Treatment in" "Both Stages" "') xtitle("") 
		ylab(-0.5 0 0.5 1, grid format(%4.1f)) yscale(r(-.5 1)) yline(0) ytitle("Mean Political Leaning")
		note("Num. obs. are `N_1', `N_2', and `N_3', respectively.")
	;
	#d cr
	

	graph export `Figure_A7_1_2', as(png) name("Graph") replace

restore

/* Figure A7.1.3 Reported Party Preference Across Respondents' Survey Experience
------------------------------------------------------------------------------- */
	*** panel (a) - Republican ***
	preserve

		* Obtain p-values
		qui reg party_republican black_only if white_only == 0, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]  // p = .553
		di "Black Treatment in Both Stages vs Switchers = `P_VALUE'."

		qui reg party_republican switcher if black_only == 0, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1] // p = .484
		di "Switchers vs White Treatment in Both Stages = `P_VALUE'."

		qui reg party_republican white_only if switcher == 0, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1] // p = .305
		di "Black Treatment in Both Stages vs White Treatment in Both Stages = `P_VALUE'."
		 
		gen experience = 1 if black_only == 1
		replace experience = 2 if switcher == 1
		replace experience = 3 if white_only == 1


		* Obtain CIs for the figure 
		mean party_republican if experience == 1, cluster(randomid)

			scalar  hirep_1 = r(table)["ul", "party_republican"]
			scalar lowrep_1 = r(table)["ll", "party_republican"]
			loc		  	 N_1 = e(N)
			
		mean party_republican if experience == 2, cluster(randomid)
		
			scalar  hirep_2 = r(table)["ul", "party_republican"]
			scalar lowrep_2 = r(table)["ll", "party_republican"]	
			loc		  	 N_2 = e(N)

		mean party_republican if experience == 3, cluster(randomid)

			scalar  hirep_3 = r(table)["ul", "party_republican"]
			scalar lowrep_3 = r(table)["ll", "party_republican"]
			loc		  	 N_3 = e(N)
				

		collapse (mean) meanrep = party_republican (sd) sdrep = party_republican (count) n=party_republican, by(experience)

				gen 	 hirep = hirep_1 if experience == 1
				replace  hirep = hirep_2 if experience == 2
				replace  hirep = hirep_3 if experience == 3
		
				gen		 lowrep = lowrep_1 if experience == 1
				replace  lowrep = lowrep_2 if experience == 2
				replace  lowrep = lowrep_3 if experience == 3
				
				assert n == `N_1' if experience == 1
				assert n == `N_2' if experience == 2
				assert n == `N_3' if experience == 3	

		gen x = experience if experience == 1
		replace x = experience + 0.25 if experience == 2
		replace x = experience + 0.50 if experience == 3

		sort x

	#d;
		graph twoway 
		(bar meanrep x if experience == 1, color(cranberry*.55)) 
		(bar meanrep x if experience == 2, color(cranberry*.55)) 
		(bar meanrep x if experience == 3, color(cranberry*.55)) 
		(scatter meanrep x if experience == 1, msymbol(none) mlabcolor(black) mlabel(meanrep) mlabformat(%4.2f) mlabposition(2))
		(scatter meanrep x if experience == 2, msymbol(none) mlabcolor(black) mlabel(meanrep) mlabformat(%4.2f) mlabposition(2))
		(scatter meanrep x if experience == 3, msymbol(none) mlabcolor(black) mlabel(meanrep) mlabformat(%4.2f) mlabposition(2))
		(rcap hirep lowrep x,lcolor(black))
		, legend(off) 
		xlabel(1 `" "Black Treatment in" "Both Stages" "' 2.25 `" "Switch Treatments" "Between Stages" "' 3.50 `" "White Treatment in" "Both Stages" "') xtitle("") 
		ylab(-0.5 0 0.5 1, grid format(%4.1f)) yscale(r(-.5 1)) yline(0) ytitle("Fraction of Respondents that are Republican") title("(a)", size(medium))
		note("Num. obs. are `N_1', `N_2', and `N_3', respectively.")
	;
	#d cr

		graph export `Figure_A7_1_3a', as(png) name("Graph") replace 

	restore
	
	*** panel (b) - Democrats ***
	preserve

		* Obtain p-values
		qui reg party_democrat black_only if white_only == 0, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1]  // p = .482
		di "Black Treatment in Both Stages vs Switchers = `P_VALUE'."

		qui reg party_democrat switcher if black_only == 0, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1] // p = .310
		di "Switchers vs White Treatment in Both Stages = `P_VALUE'."

		qui reg party_democrat white_only if switcher == 0, cluster(randomid)
		loc P_VALUE: di %6.3f r(table)[4,1] // p = .173
		di "Black Treatment in Both Stages vs White Treatment in Both Stages = `P_VALUE'."
		 
		gen experience = 1 if black_only == 1
		replace experience = 2 if switcher == 1
		replace experience = 3 if white_only == 1


		* Obtain CIs for the figure 
		mean party_democrat if experience == 1, cluster(randomid)

			scalar  hidem_1 = r(table)["ul", "party_democrat"]
			scalar lowdem_1 = r(table)["ll", "party_democrat"]
			loc		  	 N_1 = e(N)
			
		mean party_democrat if experience == 2, cluster(randomid)
		
			scalar  hidem_2 = r(table)["ul", "party_democrat"]
			scalar lowdem_2 = r(table)["ll", "party_democrat"]	
			loc		  	 N_2 = e(N)

		mean party_democrat if experience == 3, cluster(randomid)

			scalar  hidem_3 = r(table)["ul", "party_democrat"]
			scalar lowdem_3 = r(table)["ll", "party_democrat"]
			loc		  	 N_3 = e(N)
				

		collapse (mean) meandem = party_democrat (sd) sddem = party_democrat (count) n=party_democrat, by(experience)

				gen 	 hidem = hidem_1 if experience == 1
				replace  hidem = hidem_2 if experience == 2
				replace  hidem = hidem_3 if experience == 3
		
				gen		 lowdem = lowdem_1 if experience == 1
				replace  lowdem = lowdem_2 if experience == 2
				replace  lowdem = lowdem_3 if experience == 3
				
				assert n == `N_1' if experience == 1
				assert n == `N_2' if experience == 2
				assert n == `N_3' if experience == 3	

		gen x = experience if experience == 1
		replace x = experience + 0.25 if experience == 2
		replace x = experience + 0.50 if experience == 3

		sort x

	#d;
		graph twoway 
		(bar meandem x if experience == 1, color(cranberry*.55)) 
		(bar meandem x if experience == 2, color(cranberry*.55)) 
		(bar meandem x if experience == 3, color(cranberry*.55)) 
		(scatter meandem x if experience == 1, msymbol(none) mlabcolor(black) mlabel(meandem) mlabformat(%4.2f) mlabposition(2))
		(scatter meandem x if experience == 2, msymbol(none) mlabcolor(black) mlabel(meandem) mlabformat(%4.2f) mlabposition(2))
		(scatter meandem x if experience == 3, msymbol(none) mlabcolor(black) mlabel(meandem) mlabformat(%4.2f) mlabposition(2))
		(rcap hidem lowdem x,lcolor(black))
		, legend(off) 
		xlabel(1 `" "Black Treatment in" "Both Stages" "' 2.25 `" "Switch Treatments" "Between Stages" "' 3.50 `" "White Treatment in" "Both Stages" "') xtitle("") 
		ylab(-0.5 0 0.5 1, grid format(%4.1f)) yscale(r(-.5 1)) yline(0) ytitle("Fraction of Respondents that are Democrat") title("(b)", size(medium))
		note("Num. obs. are `N_1', `N_2', and `N_3', respectively.")
	;
	#d cr

		graph export `Figure_A7_1_3b', as(png) name("Graph") replace 

	restore

		
	
/* Figure A7.2.1: Race Treatment Order Effects for Group 1 
------------------------------------------------------------------------------- */

gen high_bro = (((mod == 1 | lib == 1) & bro >= 0) | conserv == 1)


preserve

	keep if high_bro == 1

	keep if stage_two == 1

	gen treat = (black == 1)
	replace treat = 2 if black == 0

	gen first = (black1 == 1)
	replace first = 2 if black1 == 0

	** footnotes:
	* A vs B
	reg fair black1 if black == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .582
	di "A vs B, p = `P_VALUE'."
	
	* C vs D
	reg fair black1 if black == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .769
	di "C vs D, p = `P_VALUE'." 

	* A vs C
	reg fair black if black1 == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .930
	di "A vs C, p = `P_VALUE'." 

	* B vs D
	reg fair black if black1 == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .921
	di "B vs D, p = `P_VALUE'." 
	
	
	* Obtain CIs for the figure 
	mean fair if treat == 1 & first == 1, cluster(randomid)

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if treat == 1 & first == 2, cluster(randomid)
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if treat == 2 & first == 1, cluster(randomid)

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if treat == 2 & first == 2, cluster(randomid)

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	
	
	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(treat first)

			gen 	 hifair = hifair_1 if first == 1 & treat == 1
			replace  hifair = hifair_2 if first == 2 & treat == 1
			replace  hifair = hifair_3 if first == 1 & treat == 2
			replace  hifair = hifair_4 if first == 2 & treat == 2
		
			gen		 lowfair = lowfair_1 if first == 1 & treat == 1
			replace  lowfair = lowfair_2 if first == 2 & treat == 1
			replace  lowfair = lowfair_3 if first == 1 & treat == 2
			replace  lowfair = lowfair_4 if first == 2 & treat == 2

				assert n == `N_1' if first == 1 & treat == 1
				assert n == `N_2' if first == 2 & treat == 1
				assert n == `N_3' if first == 1 & treat == 2
				assert n == `N_4' if first == 2 & treat == 2

	gen x = 1 if first == 1
	replace x = first + 1 if first == 2

	#d;
		twoway 
		(bar meanfair x if treat == 1 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 1 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 1 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(scatter meanfair x if treat == 1 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(rcap hifair lowfair x if treat == 1 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 1 & first == 2,lcolor(black))
		, legend(off) 
		title("Fairness of Anti-Black" "Discrimination in Stage 2" "(a)", size(medium)) 
		xlabel(1 `""A" "Black Treatment" "in Stage 1""' 3 `""B" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-0.5 1)) ylabel(-0.5(0.5)1, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1' and `N_2' respectively.")
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_2_1a.gph", replace

	#d;
		twoway 
		(bar meanfair x if treat == 2 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 2 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 2 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(scatter meanfair x if treat == 2 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(rcap hifair lowfair x if treat == 2 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 2 & first == 2,lcolor(black))
		, legend(off) 
		title( "Fairness of Anti-White" "Discrimination in Stage 2" "(b)", size(medium)) 
		xlabel(1 `""C" "Black Treatment" "in Stage 1""' 3 `""D" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-0.5 1)) ylabel(-0.5(0.5)1, nolabels noticks grid format(%4.1f)) ytitle("")
		note("Num. obs. are `N_3' and `N_4' respectively.")
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_2_1b.gph", replace

	graph combine "$FIG_TMP/Figure_A7_2_1a.gph" "$FIG_TMP/Figure_A7_2_1b.gph"

	graph export `Figure_A7_2_1', replace

restore 


/* Figure A7.2.2: Race Treatment Order Effects for Group 2
------------------------------------------------------------------------------- */
gen low_bro = ((mod == 1 | lib == 1) & bro < 0)


preserve

	keep if low_bro == 1

	keep if stage_two == 1

	gen treat = (black == 1)
	replace treat = 2 if black == 0

	gen first = (black1 == 1)
	replace first = 2 if black1 == 0

	** footnotes:
	* A vs B
	reg fair black1 if black == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .013
	di "A vs B, p = `P_VALUE'."
	
	* C vs D
	reg fair black1 if black == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .296
	di "C vs D, p = `P_VALUE'." 

	* A vs C
	reg fair black if black1 == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .002
	di "A vs C, p = `P_VALUE'." 

	* B vs D
	reg fair black if black1 == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .740
	di "B vs D, p = `P_VALUE'." 
	
	
	* Obtain CIs for the figure 
	mean fair if treat == 1 & first == 1, cluster(randomid)

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if treat == 1 & first == 2, cluster(randomid)
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if treat == 2 & first == 1, cluster(randomid)

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if treat == 2 & first == 2, cluster(randomid)

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	
	
	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(treat first)

			gen 	 hifair = hifair_1 if first == 1 & treat == 1
			replace  hifair = hifair_2 if first == 2 & treat == 1
			replace  hifair = hifair_3 if first == 1 & treat == 2
			replace  hifair = hifair_4 if first == 2 & treat == 2
		
			gen		 lowfair = lowfair_1 if first == 1 & treat == 1
			replace  lowfair = lowfair_2 if first == 2 & treat == 1
			replace  lowfair = lowfair_3 if first == 1 & treat == 2
			replace  lowfair = lowfair_4 if first == 2 & treat == 2

				assert n == `N_1' if first == 1 & treat == 1
				assert n == `N_2' if first == 2 & treat == 1
				assert n == `N_3' if first == 1 & treat == 2
				assert n == `N_4' if first == 2 & treat == 2

	gen x = 1 if first == 1
	replace x = first + 1 if first == 2

	#d;
		twoway 
		(bar meanfair x if treat == 1 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 1 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 1 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(scatter meanfair x if treat == 1 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(rcap hifair lowfair x if treat == 1 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 1 & first == 2,lcolor(black))
		, legend(off) 
		title("Fairness of Anti-Black" "Discrimination in Stage 2" "(a)", size(medium)) 
		xlabel(1 `""A" "Black Treatment" "in Stage 1""' 3 `""B" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.9 0)) ylabel(-1.5(0.5)0, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1' and `N_2' respectively.")
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_2_2a.gph", replace

	#d;
		twoway 
		(bar meanfair x if treat == 2 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 2 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 2 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(scatter meanfair x if treat == 2 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(rcap hifair lowfair x if treat == 2 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 2 & first == 2,lcolor(black))
		, legend(off) 
		title( "Fairness of Anti-White" "Discrimination in Stage 2" "(b)", size(medium)) 
		xlabel(1 `""C" "Black Treatment" "in Stage 1""' 3 `""D" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.9 0)) ylabel(-1.5(0.5)0, nolabels noticks grid format(%4.1f)) ytitle("")
		note("Num. obs. are `N_3' and `N_4' respectively.")		
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_2_2b.gph", replace

	graph combine "$FIG_TMP/Figure_A7_2_2a.gph" "$FIG_TMP/Figure_A7_2_2b.gph"

	graph export `Figure_A7_2_2', replace

restore 


/* Figure A7.4.1: Race Treatment Order Effects for Conservative Respondents
------------------------------------------------------------------------------- */
preserve

	keep if conserv == 1

	keep if stage_two == 1

	gen treat = (black == 1)
	replace treat = 2 if black == 0

	gen first = (black1 == 1)
	replace first = 2 if black1 == 0

	** footnotes:
	* A vs B
	reg fair black1 if black == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .739
	di "A vs B, p = `P_VALUE'."
	
	* C vs D
	reg fair black1 if black == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .829
	di "C vs D, p = `P_VALUE'." 

	* A vs C
	reg fair black if black1 == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .750
	di "A vs C, p = `P_VALUE'." 

	* B vs D
	reg fair black if black1 == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .460
	di "B vs D, p = `P_VALUE'." 
	
	
	* Obtain CIs for the figure 
	mean fair if treat == 1 & first == 1, cluster(randomid)

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if treat == 1 & first == 2, cluster(randomid)
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if treat == 2 & first == 1, cluster(randomid)

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if treat == 2 & first == 2, cluster(randomid)

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	
	
	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(treat first)

			gen 	 hifair = hifair_1 if first == 1 & treat == 1
			replace  hifair = hifair_2 if first == 2 & treat == 1
			replace  hifair = hifair_3 if first == 1 & treat == 2
			replace  hifair = hifair_4 if first == 2 & treat == 2
		
			gen		 lowfair = lowfair_1 if first == 1 & treat == 1
			replace  lowfair = lowfair_2 if first == 2 & treat == 1
			replace  lowfair = lowfair_3 if first == 1 & treat == 2
			replace  lowfair = lowfair_4 if first == 2 & treat == 2

				assert n == `N_1' if first == 1 & treat == 1
				assert n == `N_2' if first == 2 & treat == 1
				assert n == `N_3' if first == 1 & treat == 2
				assert n == `N_4' if first == 2 & treat == 2

	gen x = 1 if first == 1
	replace x = first + 1 if first == 2

	#d;
		twoway 
		(bar meanfair x if treat == 1 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 1 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 1 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(scatter meanfair x if treat == 1 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(rcap hifair lowfair x if treat == 1 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 1 & first == 2,lcolor(black))
		, legend(off) 
		title("Fairness of Anti-Black" "Discrimination in Stage 2" "(a)", size(medium)) 
		xlabel(1 `""A" "Black Treatment" "in Stage 1""' 3 `""B" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-0.5 1.5)) ylabel(-0.5(0.5)1.5, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1' and `N_2' respectively.")
		;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_4_1a.gph", replace

	#d;
		twoway 
		(bar meanfair x if treat == 2 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 2 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 2 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(scatter meanfair x if treat == 2 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(2))
		(rcap hifair lowfair x if treat == 2 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 2 & first == 2,lcolor(black))
		, legend(off) 
		title( "Fairness of Anti-White" "Discrimination in Stage 2" "(b)", size(medium)) 
		xlabel(1 `""C" "Black Treatment" "in Stage 1""' 3 `""D" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-0.5 1.5)) ylabel(-0.5(0.5)1.5, nolabels noticks grid format(%4.1f)) ytitle("")
		note("Num. obs. are `N_3' and `N_4' respectively.")		
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_4_1b.gph", replace

	graph combine "$FIG_TMP/Figure_A7_4_1a.gph" "$FIG_TMP/Figure_A7_4_1b.gph"

	graph export `Figure_A7_4_1', replace

restore 


/* Figure A7.4.2: Race Treatment Order Effects for Moderate and Liberal Respondents
------------------------------------------------------------------------------- */

preserve

	keep if mod == 1 | lib == 1

	keep if stage_two == 1

	gen treat = (black == 1)
	replace treat = 2 if black == 0

	gen first = (black1 == 1)
	replace first = 2 if black1 == 0

	** footnotes:
	* A vs B
	reg fair black1 if black == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .009
	di "A vs B, p = `P_VALUE'."
	
	* C vs D
	reg fair black1 if black == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .336
	di "C vs D, p = `P_VALUE'." 

	* A vs C
	reg fair black if black1 == 1,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .005
	di "A vs C, p = `P_VALUE'." 

	* B vs D
	reg fair black if black1 == 0,cluster(randomid)
	loc P_VALUE: di %6.3f r(table)[4,1] // p = .443
	di "B vs D, p = `P_VALUE'." 
	

	* Obtain CIs for the figure 
	mean fair if treat == 1 & first == 1, cluster(randomid)

		scalar  hifair_1 = r(table)["ul", "fair"]
		scalar lowfair_1 = r(table)["ll", "fair"]
		loc		  	 N_1 = e(N)
		
	mean fair if treat == 1 & first == 2, cluster(randomid)
	
		scalar  hifair_2 = r(table)["ul", "fair"]
		scalar lowfair_2 = r(table)["ll", "fair"]	
		loc		  	 N_2 = e(N)

	mean fair if treat == 2 & first == 1, cluster(randomid)

		scalar  hifair_3 = r(table)["ul", "fair"]
		scalar lowfair_3 = r(table)["ll", "fair"]
		loc		  	 N_3 = e(N)
	
	mean fair if treat == 2 & first == 2, cluster(randomid)

		scalar  hifair_4 = r(table)["ul", "fair"]
		scalar lowfair_4 = r(table)["ll", "fair"]
		loc		  	 N_4 = e(N)
		
	collapse (mean) meanfair = fair (sd) sdfair = fair (count) n = fair,by(treat first)

			gen 	 hifair = hifair_1 if first == 1 & treat == 1
			replace  hifair = hifair_2 if first == 2 & treat == 1
			replace  hifair = hifair_3 if first == 1 & treat == 2
			replace  hifair = hifair_4 if first == 2 & treat == 2
		
			gen		 lowfair = lowfair_1 if first == 1 & treat == 1
			replace  lowfair = lowfair_2 if first == 2 & treat == 1
			replace  lowfair = lowfair_3 if first == 1 & treat == 2
			replace  lowfair = lowfair_4 if first == 2 & treat == 2

				assert n == `N_1' if first == 1 & treat == 1
				assert n == `N_2' if first == 2 & treat == 1
				assert n == `N_3' if first == 1 & treat == 2
				assert n == `N_4' if first == 2 & treat == 2

	gen x = 1 if first == 1
	replace x = first + 1 if first == 2

	#d;
		twoway 
		(bar meanfair x if treat == 1 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 1 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 1 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(scatter meanfair x if treat == 1 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(rcap hifair lowfair x if treat == 1 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 1 & first == 2,lcolor(black))
		, legend(off) 
		title("Fairness of Anti-Black" "Discrimination in Stage 2" "(a)", size(medium)) 
		xlabel(1 `""A" "Black Treatment" "in Stage 1""' 3 `""B" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.5 0)) ylabel(-1.5(0.5)0, grid format(%4.1f)) ytitle("Mean Fairness Evaluation")
		note("Num. obs. are `N_1' and `N_2' respectively.")		
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_4_2a.gph", replace

	#d;
		twoway 
		(bar meanfair x if treat == 2 & first == 1, color(cranberry*.55)) 
		(bar meanfair x if treat == 2 & first == 2, color(eltblue*.50)) 
		(scatter meanfair x if treat == 2 & first == 1, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(scatter meanfair x if treat == 2 & first == 2, msymbol(none) mlabcolor(black) mlabel(meanfair) mlabformat(%4.2f) mlabposition(4))
		(rcap hifair lowfair x if treat == 2 & first == 1,lcolor(black)) 
		(rcap hifair lowfair x if treat == 2 & first == 2,lcolor(black))
		, legend(off) 
		title( "Fairness of Anti-White" "Discrimination in Stage 2" "(b)", size(medium)) 
		xlabel(1 `""C" "Black Treatment" "in Stage 1""' 3 `""D" "White Treatment" "in Stage 1""') xtitle("") xsc(r(0 4)) 
		yline(0) ysc(r(-1.5 0)) ylabel(-1.5(0.5)0, nolabels noticks grid format(%4.1f)) ytitle("")
		note("Num. obs. are `N_3' and `N_4' respectively.")		
	;
	#d cr
	
	graph save "$FIG_TMP/Figure_A7_4_2b.gph", replace

	graph combine "$FIG_TMP/Figure_A7_4_2a.gph" "$FIG_TMP/Figure_A7_4_2b.gph"

	graph export `Figure_A7_4_2', replace

restore 



/* ******************************** Appendix 8 ******************************** */	

/* Figure A8.1: Replicates Figure 1: with ACS Weights
------------------------------------------------------------------------------- */
	loc WEIGHT  "[pweight = survey_weight]"

	* Panel (a) - Anti-Black
	preserve

		keep if black==1

		keep if stage_one == 1

				reg fair bro if conserv==1 `WEIGHT' , cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)

				reg fair bro if conserv==0 `WEIGHT' , cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid `WEIGHT', by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [pw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [pw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(a)") subtitle("Anti-Black Discrimination") xtitle("BRO Measure") ytitle(" Mean Fairness Assessment") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		
		graph save "$FIG_TMP/Figure_a8_1a.gph", replace

	restore

	* Panel (b) - Anti-White
	preserve

		keep if black==0

		keep if stage_one == 1

				reg fair bro if conserv==1 `WEIGHT' , cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)


				reg fair bro if conserv==0 `WEIGHT' , cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid `WEIGHT', by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [pw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [pw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(b)") subtitle("Anti-White Discrimination") xtitle("BRO Measure") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		graph save "$FIG_TMP/Figure_a8_1b.gph", replace

	restore 

	* Combine (a) and (b)
	
	grc1leg "$FIG_TMP/Figure_a8_1a.gph" "$FIG_TMP/Figure_a8_1b.gph", xsize(8) ysize(5) legendfrom("$FIG_TMP/Figure_a8_1a.gph")
	graph export "`Figure_A8_1'", as(png) name("Graph") replace
	
	
	** footnotes: extra p-values

	di "Tests of Political Differences in the Fairness of Anti-Black Discrimination, by Integer Values of BRO: "
	qui reg bro_n3 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P1: di %6.3f r(table)[4,1] // p = .001
		di "Conservatives vs. Mods-Libs, BRO = -3 only, p=`P1'"
		
	qui reg bro_n2 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P2: di %6.3f r(table)[4,1] // p = .000
		di "Conservatives vs. Mods-Libs, BRO = -2 only, p=`P2'"
		
	qui reg bro_n1 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P3: di %6.3f r(table)[4,1] // p = .448
		di "Conservatives vs. Mods-Libs, BRO = -1 only, p=`P3'"
		
	qui reg bro_0_3 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P4: di %6.3f r(table)[4,1] // p = .000
		di "Conservatives vs. Mods-Libs, BRO = 0 to +3 combined, p=`P4'"


/* ******************************** Appendix 9 ******************************** */


/* Figure A9.1: Replicates Figure 1: with GSS Weights
------------------------------------------------------------------------------- */
	loc WEIGHT  "[pweight = survey_weight2]"

	* Panel (a) - Anti-Black
	preserve

		keep if black==1

		keep if stage_one == 1

				reg fair bro if conserv==1 `WEIGHT' , cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)

				reg fair bro if conserv==0 `WEIGHT' , cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid `WEIGHT', by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [pw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [pw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(a)") subtitle("Anti-Black Discrimination") xtitle("BRO Measure") ytitle(" Mean Fairness Assessment") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		
		graph save "$FIG_TMP/Figure_a9_1a.gph", replace

	restore

	* Panel (b) - Anti-White
	preserve

		keep if black==0

		keep if stage_one == 1

				reg fair bro if conserv==1 `WEIGHT' , cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)


				reg fair bro if conserv==0 `WEIGHT' , cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid `WEIGHT', by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [pw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [pw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(b)") subtitle("Anti-White Discrimination") xtitle("BRO Measure") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		graph save "$FIG_TMP/Figure_a9_1b.gph", replace

	restore 

	* Combine (a) and (b)
	
	grc1leg "$FIG_TMP/Figure_a9_1a.gph" "$FIG_TMP/Figure_a9_1b.gph", xsize(8) ysize(5) legendfrom("$FIG_TMP/Figure_a9_1a.gph")
	graph export "`Figure_A9_1'", as(png) name("Graph") replace
	
	
	** footnotes: extra p-values

	di "Tests of Political Differences in the Fairness of Anti-Black Discrimination, by Integer Values of BRO: "
	qui reg bro_n3 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P1: di %6.3f r(table)[4,1] // p = .001
		di "Conservatives vs. Mods-Libs, BRO = -3 only, p=`P1'"
		
	qui reg bro_n2 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P2: di %6.3f r(table)[4,1] // p = .001
		di "Conservatives vs. Mods-Libs, BRO = -2 only, p=`P2'"
		
	qui reg bro_n1 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P3: di %6.3f r(table)[4,1] // p = .612
		di "Conservatives vs. Mods-Libs, BRO = -1 only, p=`P3'"
		
	qui reg bro_0_3 conserv if ordering == 1 & black == 1 `WEIGHT', cluster(randomid)
		loc P4: di %6.3f r(table)[4,1] // p = .000
		di "Conservatives vs. Mods-Libs, BRO = 0 to +3 combined, p=`P4'"

		
/* ******************************** Appendix 10 ******************************** */

/* Figure A10.1: Replicates Figure 1: for 'Thoughtful' Subjects Only
------------------------------------------------------------------------------- */
	gen thoughtful = (durationinseconds > 502)
	
	* Panel (a) - Anti-Black
	preserve
	
		keep if thoughtful == 1

		keep if black==1

		keep if stage_one == 1

				reg fair bro if conserv==1, cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)


				reg fair bro if conserv==0, cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid, by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [fw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [fw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(a)") subtitle("Anti-Black Discrimination") xtitle("BRO Measure") ytitle(" Mean Fairness Assessment") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		
		graph save "$FIG_TMP/Figure_a10_1a.gph", replace

	restore

	* Panel (b) - Anti-White
	preserve
	
		keep if thoughtful == 1

		keep if black==0

		keep if stage_one == 1

				reg fair bro if conserv==1, cluster(randomid)
				loc b_cons: di %6.3f _b[bro]
				loc p_cons: di %6.3f r(table)[4,1] 
				loc N_cons= e(N)

				reg fair bro if conserv==0, cluster(randomid)
				loc b_nocons: di %6.3f _b[bro]
				loc p_nocons: di %6.3f r(table)[4,1] 
				loc N_nocons= e(N)

		collapse (mean) fair  (count) n=randomid, by(bro conserv)

		gen fair_conserv = fair if conserv==1
		gen fair_libmod  = fair if conserv==0

		qui reg fair_conserv bro [fw=n]
			predict fair_conserv_hat
		qui reg fair_libmod  bro [fw=n]
			predict fair_libmod_hat

		#delim;
			twoway 
			(scatter fair_conserv_hat bro [w=n]				, s(i) c(l) lcolor(red)   lwidth(thick) 	lpattern(dash)) 
			(scatter fair_conserv     bro [w=n]				, m(Oh) 	mlcolor(red)  mlwidth(medthick)) 
			(scatter fair_libmod_hat  bro [w=n]				, s(i) c(l) lcolor(navy)  lwidth(thick) 	lpattern(solid))
			(scatter fair_libmod      bro [w=n] if bro <  0	, m(T)		mlcolor(navy) mlwidth(medthick) mfcolor(navy%40)) 
			(scatter fair_libmod      bro [w=n] if bro >= 0	, m(Th) 	mlcolor(navy) mlwidth(medthick)) 
			(scatteri 1.7 -4 (3) "Conservatives: slope=`b_cons', p=`p_cons'", ms(none) mlabcolor(red)  mlabsize(small))
			(scatteri 1.9 -4 (3) "Moderates and Liberals: slope=`b_nocons', p=`p_nocons'", ms(none) mlabcolor(navy)  mlabsize(small))
			, 
			yscale(r(-2 2)) ylabel(-2(1)2, grid) 
			xtick(-4(1)4) xlabel(-4(2)4) 
			title("(b)") subtitle("Anti-White Discrimination") xtitle("BRO Measure") 
			legend(	row(2) size(small)
					order(- "Conservatives:" 		  1 "Predicted" 2 "Obs" 					- " "
						  - "Moderates and Liberals:" 3 "Predicted" 4 "Obs with BRO {&lt} 0" 5 "Obs with BRO {&ge} 0")) 
			note("Conservatives: N=`N_cons', Moderates and Liberals: N=`N_nocons'")
				;
		#delim cr	
		graph save "$FIG_TMP/Figure_a10_1b.gph", replace


	* Combine (a) and (b)
	
	grc1leg "$FIG_TMP/Figure_a10_1a.gph" "$FIG_TMP/Figure_a10_1b.gph", xsize(8) ysize(5) legendfrom("$FIG_TMP/Figure_a10_1a.gph")
	graph export "`Figure_A10_1'", as(png) name("Graph") replace
	restore 
	
	preserve
	
		keep if thoughtful == 1
	
		** footnotes: extra p-values

		di "Tests of Political Differences in the Fairness of Anti-Black Discrimination, by Integer Values of BRO: "
		qui reg bro_n3 conserv if ordering == 1 & black == 1, cluster(randomid)
			loc P1: di %6.3f r(table)[4,1] // p = 0.024
			di "Conservatives vs. Mods-Libs, BRO = -3 only, p=`P1'"
			
		qui reg bro_n2 conserv if ordering == 1 & black == 1, cluster(randomid)
			loc P2: di %6.3f r(table)[4,1] // p = 0.105
			di "Conservatives vs. Mods-Libs, BRO = -2 only, p=`P2'"
			
		qui reg bro_n1 conserv if ordering == 1 & black == 1, cluster(randomid)
			loc P3: di %6.3f r(table)[4,1] // p = 0.815
			di "Conservatives vs. Mods-Libs, BRO = -1 only, p=`P3'"
			
		qui reg bro_0_3 conserv if ordering == 1 & black == 1, cluster(randomid)
			loc P4: di %6.3f r(table)[4,1] // p = 0.012
			di "Conservatives vs. Mods-Libs, BRO = 0 to +3 combined, p=`P4'"

	restore 



	
	